Jump to content

Search the Community

Showing results for tags 'php'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Job Boards
    • Jobs
  • Community Lounge and FAQ
    • Forum News
    • Open Forum
    • New Members Forum - Start Here!
  • Entrepreneurship, Business and Marketing
    • Social Media Marketing & Web Marketing
    • Entrepreneurship
    • Career Questions - Asked and Answered
  • StudioWeb
    • StudioWeb
    • StudioWeb News
    • StudioWeb Projects
  • Programming
    • Python
    • Javascript
    • PHP
  • Web Design
    • Beginners Web Design
    • HTML/XHTML
    • Dreamweaver
    • CSS
    • Advanced Web Design
    • Business of Web Design
    • Web Design News
  • Miscellaneous
    • Cybersecurity
    • Miscellaneous Software
    • Blogs and CMS
    • Web Accessibility
    • Peer-to-Peer Reviews
    • Website Templates
    • Web Design Jobs
    • Test Forum
  • Archives
    • Beginners Web Design
    • Course: The Complete Entrepreneur
    • Web Accessibility
    • Photoshop
    • CSS
    • Forum Rules and Etiquette
    • Flash
    • ASP
    • General Programming
    • Expression Web
    • Beginners Ruby
    • Killersites University
    • Actionscript

Categories

There are no results to display.

There are no results to display.

Product Groups

  • Business & Entrepreneur Courses

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website


LinkedIn


Facebook


Twitter


AIM


Yahoo


Other


Location


Interests

  1. Hi, I am trying to download xml file from URLs containing feeds using CURL using the following code. The code downloads the xml file for LINK1 (below, for RSS feeds). The code downloads a HTML file (instead of xml) for LINK2 (below, for Atom feeds). If I open LINK2 in a browser I can save it as a xml file. I do not understand why the code cannot download the xml file for LINK2. Any help will be highly appreciated. //$url = 'https://rss.sciencedirect.com/publication/science/00221694'; //LINK1 $url = 'https://onlinelibrary.wiley.com/feed/25780727/most-recent'; //LINK2 $curl = curl_init($url); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13'); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $resp = curl_exec($curl); curl_close($curl); $myfile = fopen('x.xml', "w") or die("Unable to open file!"); fwrite($myfile, $resp); fclose($myfile);
  2. I always get confused on this part. I am playing with a mySql Maria DB. in my localhost PC.... ohhh am using PDO Am I just checking for "0" failure and "1" Success return? some extra code to see how many rows effected .. in DB2 a return code of 100, meant no records were found but it was a successful execution. What kinda things do i need to check for? do the all return a code? What is the DB goes down? will my query return a code? or will it fail in another place? Besides a down DB what else must i look for? Thanks
  3. I had a difficult time solving this bug, and finally solved it. I'm posting it here to help others who might be struggling with the same situation. Code Source: This code is from the Simple PHP Login System, Lesson 17 & 18. My Setup: Machine: Windows 10 WAMP PHP version: 7.4.9 Code Editor: VS Code Here is my error notice: Notice: Only variables should be passed by reference in C:\wamp64\www\phplogin-parts17-18-projectfiles\register.php on line 144 I got that error message when I tried to register a member. The problem lies in LINE 144 SOLUTION: You need to create a new variable that represents... md5($input['pass'] . $config['salt']) Let's call that variable $salty.... $salty = md5($input['pass'] . $config['salt']); ...and then insert that new variable $salty into ... $stmt->bind_param(x, x, x, x, $salty); The code should look like this: if ($stmt = $mysqli->prepare("INSERT members (username, email, type, password) VALUES (?,?,?,?)")) { $salty = md5($input['pass'] . $config['salt']); $stmt->bind_param("ssss", $input['user'], $input['email'], $input['type'], $salty); $stmt->execute(); $stmt->close(); Hope that helps! Stephen
  4. Hi, I'm currently doing the shopping cart tutorial in studioweb projects. Minor errors appear whenever I add items to the cart and i'm using php 7.2.10. I'll add the screenshot below. I've tried to solve it but the errors won't go away.
  5. Hey guys! So far my website is looking great! Just trying to get this contact form to function. Wondering if everything lines up: HTML code: <!--contact-form-------------------> <section id="contact-form"> <form> <!--left---------------------------------------> <div class="contact-left"> <h1 class="c-l-heading"><font style="border-bottom: 3px solid #1ED98B;">Writ</font>e Me</h1> <!--name--------> <div class="f-name"> <font >Name</font> <input type="text" placeholder="Full Name"/> </div> <!--email--------> <div class="f-email"> <font >Email</font> <input type="email" placeholder="Example@gmail.com"/> </div> </div> <!--right-------------------------------------------> <div class="contact-right"> <!--message--------> <div class="message"> <font >Message</font> <textarea name="message" rows="5" cols="20" placeholder="Write Message..."></textarea> </div> <!--submit-btn------------> <button>submit</button> </div> </form> </section> php: ?php $name = $_POST['name']; /*this will display the name of the users */ $visitor_email = $_Post['email']; /*this will display the email of the user */ $message = $_POST['message']; /*this will store the message */ $email_from = 'Ryan-vand@outlook.com' /*I will receive this via this line of code */ $email_subject = "new form submission"; $email_body = "User Name: $name.\n"."User Email: $visitor_email.\n"."User Message: $message.\n"; $to = "Ryan-vand@outlook.com"; $headers = "From: $email_from\r\n"; mail($to,$email_subject,$email_body,$headers); header("Location: firstdraft.html"); ?>
  6. Hello guys, I just wanted to see the path that you guys take when making functionality changes in wordpress. In other words, how do you trace a specific functionality from the front end to the code responsible for it in the back end. Any suggestion will be appreciated!!
  7. Guest

    PHP Login System

    So, I have followed the instructions to a 'T,' yet I get a notice after I update the password. I thought I might be missing something from the videos, so I cut what I typed out and copied and pasted the source code files for the video section in it, but the exact same notice rendered in the browser. Any idea what's up with the notice? Does it have to do with deprecated code from previous versions, since Ben's browser was not rendering the same notice? else { // insert into database if ($stmt = $mysqli->prepare("UPDATE members SET password = ? WHERE id = ?")) { $stmt->bind_param("ss", md5($input['pass'] . $config['salt']), $_SESSION['id']); $stmt->execute(); $stmt->close(); // add alert and clear form values $error['alert'] = 'Password updated successfully!'; $input['current_pass'] = ''; $input['pass'] = ''; $input['pass2'] = ''; // show form include('views/v_password.php'); } else { echo "ERROR: Could not prepare MySQLi statement."; } }
  8. The var_dump of the $cart_items array is supposed to show an array of $cart_items with the quantities added together for the same id but it doesn't even show an array, it just shows one value. session_start(); $cart_items = $_SESSION["cart_items"]; if ( $cart_items == null ) { $cart_items = array(); } if ( isset($_REQUEST["element_id"]) ) { $id = $_REQUEST["element_id"]; } if ( isset($_REQUEST["quantity"]) ) { $quantity = $_REQUEST["quantity"]; } if ( isset($id) && isset($quantity) ) { if (isset($cart_items[$id])) { $cart_items[$id] += $quantity; } else { $cart_items[$id] = $quantity; } } var_dump($cart_items);
  9. I've been studying SQL and PHP, but something isn't clicking in my brain about how to use then together. Could someone explain the connection and formatting PHP code with SQL queries or refer me to a tutorial please?
  10. How do I style this table to make it look "prettier" I have tried a little with css and html tags with no luck. // display data in table echo "<table border='1' cellpadding='10'>"; echo "<tr> <th>ID</th> <th>First Name</th><th>Middle Name</th> <th>Last Name</th><th>Client ID</th><th>Diagnosis</th><th>Gender</th><th>Level of Care</th><th>Counselor</th><th>Active</th><th>Aftercare</th></tr>"; // loop through results of database query, displaying them in the table for ($i = $start; $i < $end; $i++) { // make sure that PHP doesn't try to show results that don't exist if ($i == $total_results) { break; } // find specific row $result->data_seek($i); $row = $result->fetch_row(); // echo out the contents of each row into a table echo "<tr>"; echo '<td>' . $row[0] . '</td>'; echo '<td>' . $row[3] . '</td>'; echo '<td>' . $row[1] . '</td>'; echo '<td>' . $row[2] . '</td>'; echo '<td>' . $row[4] . '</td>'; echo '<td>' . $row[5] . '</td>'; echo '<td>' . $row[7] . '</td>'; echo '<td>' . $row[10] . '</td>'; echo '<td>' . $row[11] . '</td>'; echo '<td>' . $row[15] . '</td>'; echo '<td>' . $row[18] . '</td>'; echo '<td><a href="records.php?id=' . $row[0] . '">Edit</a></td>'; echo '<td><a href="delete.php?id=' . $row[0] . '">Delete</a></td>'; echo "</tr>"; } // close table> echo "</table>";
  11. Hey, I just completed the Form Validation Project on Studioweb and I would really appreciate help regarding my doubts: 1. If we are enabling Server side validation as well as client side validation, and javascript is on, meaning validate plugin works so does the server side validation automatically turns off? in the tutorials and through my testing, its clear that PHP validation doesn't work when Validate plugin but why? Shouldn't both of them working at the same time? 2. Why do we need sessions in PHP if we can create and use associative arrays like $form['name'], $error['name'] etc. and then use them among different PHP pages? Thank you
  12. How could I find a reliable and affordable PHP web Development company.
  13. Hey guys and gals, before I ask, I do want to point out that PHP and JS seems very AWESOME to me and I really want to learn it. LIKE REALLY BAD. I am willing to do whatever I can to learn what I need to learn! So I just finished the 3rd project. Which is PHP Tag Cloud. And I am still having some trouble understanding what's going on within the code. For example, I am understanding the concepts of a 'loop' or 'if' and 'else', and 'while.' I get what they are doing. But, when it comes to the code itself(syntax), I am still pretty lost. In this example below, I am totally lost as far as the syntax, but I understand what we are trying to achieve. (this is a snippet of code from the downloaded zip file, not from my version of code) function get_tags() { $this->tags = array(); $this->largest = 0; // get tag id, tag name and the number of times the tag has been used $result = $this->mysqli->query("SELECT posts_to_tags.tag_id, tags.name, COUNT(posts_to_tags.tag_id) AS total FROM tags, posts_to_tags WHERE posts_to_tags.tag_id = tags.id GROUP BY posts_to_tags.tag_id"); if ($result->num_rows > 0) { while ($row = $result->fetch_object()) { // figure out which tag has been used the most often. However many times that tag was // used will be placed within $this->largest for later use if ($row->total > $this->largest) { $this->largest = $row->total; } // add tag to array $this->tags[] = array('id' => $row->tag_id, 'name' => $row->name, 'total' => $row->total); } // sort tags usort($this->tags, array('tagcloud_model', 'compare_names')); } else { // if there are no results to display $this->tags = FALSE; } } // used by the usort function within get_tags() above function compare_names($a, $b) { return strcmp($a['name'], $b['name']); } I should mention I have only been learning PHP for few days all together, only from Stef's course and these projects. Any tips, advice, or ideas on how to grasp it better?(obviously I am going to continue my learning process, videos, tutorials.) I just want to see if maybe I can understand these projects a bit better as I am learning them. Do you think I should continue the projects and trust the process as I go, or take a detour and try and understand some things more before I finish the projects? THANK YOU FOR ANY RESPONSES.
  14. I just started Beginners PHP course, when i use echo to display the result, it shows nothing. When i open beginners course file with forms it doesnt display echo on the screen as well. Can someone help me solve this problem?
  15. I feel like an idiot. I put the class php files in the C:\MAMP\htdocs. When I show them in crome I see all the code. I do not know what I am doing wrong.
  16. Hello, After following along and successfully completing Ben's tutorial of the Online Shopping Cart, I figured I would try and make my own. The first major problem I am having is being able to display my products from my database in my index.php page. The goal is to actually see the images of each product displayed in index.php (like in the tutorial). This would then enable me to add my products to the cart.php page. I've checked the database connection and it does exist. My guess would be that I am using the wrong syntax to display my products in the "fetch_all_products()" method. *** M_PRODUCTS.PHP *** <?php class Products { private $Conn; private $db_table = "toys"; function __construct() { // here we're making sure that the connection from $conn in "init.php" is transferred // into our own private $conn property for usage in this object global $Conn; $this->Conn = $Conn; } // fetches and displays all products from db public function fetch_all_products($id = NULL) { if ($id = NULL) { $data = "<li>"; if ($result = $this->conn->query("SELECT * FROM " . $this->db_table . " ORDER BY name")) { if ($result->num_rows > 0) { while ($row = $result->fetch_array()) { $data .= array( "id" => $row["product_id"], "name" => $row["name"], "price" => $row["price"], "image" => $row["image"] ); } $data .= "</li>"; return $data; } else { return "<h1>Oops... Something went wrong!</h1>"; } } } } } *** INIT.PHP *** <?php // db connection $host = "localhost"; $user = "root"; $pass = "root"; $db = "cart"; $Conn = new mysqli($host, $user, $pass, $db); // error reporting ini_set("display_errors", 1); mysqli_report(MYSQLI_REPORT_ERROR); // constants define("shop_name", "Tremendous Toys"); define("main_path", "localhost/web_apps/shopping_cart/"); define("image_path", "localhost/web_apps/shopping_cart/images/"); // includes include("models/m_shopping_cart.php"); include("models/m_products.php"); // object integrations $Shopping_Cart = new Shopping_Cart(); $Products = new Products(); // session initialisation session_start(); *** INDEX.PHP *** <?php include("init.php") ?> <link rel="stylesheet" href="visual/style.css" type="text/css"> <body> <div id="whitespace"> <h1><?php echo shop_name ?></h1> <?php $Products->fetch_all_products(); ?> </div> </body>
  17. Hello! I just finished studioWeb JavaScript course and so far its been a great experience, really good course and easy to follow but i dont feel ready to jump to PHP , i feel like i need to learn more JavaScript what you suggest me to do, i want to learn more JS but I don't know exactly what to learn , should i learn more vanilla JS or start learning a framework lile vue or react. Thanks!
  18. Php Gurus, I built a registration.php but I know not why I see a blank page after clicking "Register" button. Ignore the <center> tag for the time being. Will replace that with <p align> tag. I put echoes on conditions to see which part of the conditions get triggered. But the echoes don't occur. And, out of the following 2, which one suits my context ? $row = mysqli_fetch_array($result, MYSQLI_ASSOC); // Use this line or next ? $row = mysqli_stmt_fetch($stmt); //Use this line or previous ? registration.php <?php /* ERROR HANDLING */ declare(strict_types=1); ini_set('display_errors', '1'); ini_set('display_startup_errors', '1'); error_reporting(E_ALL); mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); include 'config.php'; //Step 1: Before registering User account, check if User is already registered or not. //Check if User is already logged-in or not. if (is_logged() === true) { die("You are already logged-in! No need to register again!"); } if ($_SERVER['REQUEST_METHOD'] == "POST") { //Step 2: Check User Submitted Details. //Check if user made all the required inputs or not. if (isset($_POST["username"]) && isset($_POST["password"]) && isset($_POST["password_confirmation"]) && isset($_POST["email"]) && isset($_POST["email_confirmation"]) && isset($_POST["first_name"]) && isset($_POST["surname"]) && isset($_POST["gender"])) { //Step 3: Check User details for matches against database. If no matches then validate inputs and register User account. //Create variables based on user inputs. $username = trim($_POST["username"]); $password = $_POST["password"]; $password_confirmation = $_POST["password_confirmation"]; $email = trim($_POST["email"]); $email_confirmation = trim($_POST["email_confirmation"]); $first_name = trim($_POST["first_name"]); $surname = trim($_POST["surname"]); $gender = $_POST["gender"]; $account_activation_code = sha1( (string) mt_rand(5, 30)); //Type Casted the INT to STRING on the 1st parameter of sha1 as it needs to be a STRING. $account_activation_link = "http://www.".$site_domain."/".$social_network_name."/activate_account.php? email=".$_POST['email']."&account_activation_code=".$account_activation_code.""; $account_activation_status = 0; // 1 = active; 0 = not active. $hashed_password = password_hash($password, PASSWORD_DEFAULT); //Encrypt the password. //Select Username and Email to check against Mysql DB if they are already registered or not. $stmt = mysqli_prepare($conn, "SELECT usernames, emails FROM users WHERE usernames = ? OR emails = ?"); mysqli_stmt_bind_param($stmt, 'ss', $username, $email); mysqli_stmt_execute($stmt); $result = mysqli_stmt_bind_result($stmt, $db_username, $db_email); //$row = mysqli_fetch_array($result, MYSQLI_ASSOC); // Use this line or next ? $row = mysqli_stmt_fetch($stmt); //Use this line or previous ? // Check if inputted Username is already registered or not. if ($row['usernames'] == $username) { $_SESSION['error'] = "That username is already registered."; exit(); // Check if inputted Username is between the required 8 to 30 characters long or not. } elseif (strlen($username) < 8 || strlen($username) > 30) { $_SESSION['error'] = "Username must be between 8 to 30 characters long!"; exit(); // Check if both inputted Emails match or not. } elseif ($email != $email_confirmation) { $_SESSION['error'] = "Emails don't match!"; exit(); // Check if inputed Email is valid or not. } elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) { $_SESSION['error'] = "Invalid email! Insert your real Email in order for us to email you your account activation details."; exit(); // Check if inputted Email is already registered or not. } elseif ($row['emails'] == $email) { $_SESSION['error'] = "That email is already registered."; exit(); // Check if both inputted Passwords match or not. } elseif ($password != $password_confirmation) { $_SESSION['error'] = "Passwords don't match."; exit(); // Check if Password is between 8 to 30 characters long or not. } elseif (strlen($password) < 8 || strlen($password) > 30) { $_SESSION['error'] = "Password must be between 6 to 30 characters long!"; exit(); echo "line 88"; } else { //Insert the user's inputs into Mysql database using php's sql injection prevention method "Prepared Statements". $stmt = mysqli_prepare($conn, "INSERT INTO users(usernames, passwords, emails, first_names, surnames, genders, accounts_activations_codes, accounts_activations_statuses) VALUES (?, ?, ?, ?, ?, ?, ?, ?)"); mysqli_stmt_bind_param($stmt, 'sssssssi', $username, $hashed_password, $email, $first_name, $surname, $gender, $account_activation_code, $account_activation_status); mysqli_stmt_execute($stmt); echo "line 96"; //Check if user's registration data was successfully submitted or not. if (!$stmt) { $_SESSION['error'] = "Sorry! Our system is currently experiencing a problem registering your account! You may try registering some other time."; echo "line 102"; exit(); } else { echo "line 107"; //Email the account activation link for user to click it to confirm their email and activate their new account. $to = $email; $subject = "Your ".$site_name." account activation details!"; $body = nl2br(" ===============================\r\n ".$site_name." \r\n ===============================\r\n From: ".$site_admin_email."\r\n To: ".$email."\r\n Subject: Yours ".$subject." \r\n Message: ".$first_name." ".$surname."\r\n You need to click on this following <a href=".$account_activation_link.">link</a> to activate your account. \r\n"); $headers = "From: " . $site_admin_email . "\r\n"; if (!mail($to,$subject,$body,$headers)) { $_SESSION['error'] = "Sorry! We have failed to email you your account activation details. Please contact the website administrator!"; exit(); } else { echo "<h3 style='text-align:center'>Thank you for your registration!<br /> Check your email for details on how to activate your account which you just registered.</h3>"; exit(); } } } } } ?> <!DOCTYPE html> <html> <head> <title><?php $social_network_name ?> Signup Page</title> </head> <body> <div class ="container"> <?php // Error Messages. if (isset($_SESSION['error']) && !empty($_SESSION['error'])) { echo '<p style="color:red;">'.$_SESSION['error'].'</p>'; } ?> <?php //Session Messages. if (isset($_SESSION['message']) && !empty($_SESSION['message'])) { echo '<p style="color:red;">'.$_SESSION['error'].'</p>'; } ?> <?php //Clear Registration Session. function clear_registration_session() { //Clear the User Form inputs, Session Messages and Session Errors so they can no longer be used. unset($_SESSION['message']); unset($_SESSION['error']); unset($_POST); exit(); } ?> <form method="post" action=""> <center><h2>Signup Form</h2></center> <div class="form-group"> <center><label>Username:</label> <input type="text" placeholder="Enter a unique Username" name="username" required [A-Za-z0-9] value="<?php if(isset($_POST['username'])) { echo htmlentities($_POST['username']); }?>"> </center> </div> <div class="form-group"> <center><label>Password:</label> <input type="password" placeholder="Enter a new Password" name="password" required [A-Za-z0-9]></center> </div> <div class="form-group"> <center><label>Repeat Password:</label> <input type="password" placeholder="Repeat a new Password" name="password_confirmation" required [A-Za-z0-9]></center> </div> <div class="form-group"> <center><label>Email:</label> <input type="email" placeholder="Enter your Email" name="email" required [A-Za-z0-9] value="<?php if(isset($_POST['email'])) { echo htmlentities($_POST['email']); }?>"></center> </div> <div class="form-group"> <center><label>Repeat Email:</label> <input type="email" placeholder="Repeat your Email" name="email_confirmation" required [A-Za-z0-9] value="<?php if(isset($_POST['email_confirmation'])) { echo htmlentities($_POST['email_confirmation']); }?>"></center> </div> <div class="form-group"> <center><label>First Name:</label> <input type="text" placeholder="Enter your First Name" name="first_name" required [A-Za-z] value="<?php if(isset($_POST['first_name'])) { echo htmlentities($_POST['first_name']); }?>"></center> </div> <div class="form-group"> <center><label>Surname:</label> <input type="text" placeholder="Enter your Surname" name="surname" required [A-Za-z] value="<?php if(isset($_POST['surname'])) { echo htmlentities($_POST['surname']); }?>"></center> </div> <div class="form-group"> <center><label>Gender:</label> <input type="radio" name="gender" value="male" <?php if(isset($_POST['gender'])) { echo 'checked'; }?> required>Male<input type="radio" name="gender" value="female" <?php if(isset($_POST['gender'])) { echo 'checked'; }?> required>Female</center> </div> <center><button type="submit" class="btn btn-default" name="submit">Register!</button></center> <center><font color="red" size="3"><b>Already have an account ?</b><br> <a href="login.php">Login here!</a></font></center> </form> </div> </body> </html>
  19. Hi people! Since I couldnt get answers from Stackoverflow I desiced to ask you. Can someone explain how does these 2 functions work: class_exists() spl_autoload_register() Class exist function if(class_exists('User')){ echo "It does exists"; } class User { /* Some code here */ } // the output of file is "It does exists" So how does this function works? Scans whole file? Whole directory? I mean its called before I defined class. Spl autoload register function include 'functions.php'; // <- file where is the function class_exist('User') and spl_autoload_register() include 'db_config.php'; include 'database.php'; include 'user.php'; // <- Here is the class (User) So how does this function work? Its before any of those files that are included, and still it does it work? Does it scans whole directory where it is or what? I am really confused. Thanks peeps!
  20. What does mean that variable is set or not set? (in PHP or general) Does that means: // no var declared $var; $var = 'Some fancy string'; $var = ""; //(empty string) I dont know all fancy terms, but I do know when variable is defined, declared and all that, but I dont know what variable is set means. Thanks in advance, nerdz!
  21. Hi everyone, I'm currently on Chapter 4 of the PHP course and I'm having problems following up everything since I'm using ubuntu linux instead of a mac or windows pc. As a result, I can't install MAMP and I've had to try a couple of alternatives (LAMP and XAMPP) but neither seem to be similar enough to the MAMP that Stef uses in his videos (LAMP doesn't seem to have a user interface at all and XAMPP doesn't have a simple user friendly UI like MAMP does, which allows you to search files , like Stef does in lesson 2 chapt. 4 in order to find php.ini). Is there a better MAMP alternative for ubuntu? Also, when I search my computer, I have 3 different php.ini files in the following directories: /opt/lampp/etc /etc/php/7.0/apache2 /etc/php/7.0/cli Which one of the three am I meant to modify so that I can enable error messages? All of them have restricted writing permissions ("You are not the owner so you cannot change these permissions"). Any advice will be appreciated. Thanks in advance.
  22. Hi there I've just started a fresh website for a non-profit organisation (meaning I won't get paid), so my options are: doing it as fast as possible, with minimum costs, standard interface, easy maintenance, strong community support. Therefore, being pragmatic, I've chosen WordPress (but i struggled finding out an appropriate free plugin... so I need to code it: PHP + mysqli). Now, this npo asked me for me a simple booking system for their training sessions. The business rules are: 1) several sessions available: A, B, C and D 2) A B C and D happen several times in a week 3) each user can book all 4, but can only book 1x (for the each session) 4) limit of seats per session: 20 5) total users : 100 (some will be left out, as soon as limit has been reached). 6) priority : FIFE (first in , first ENROLLED) 4) no payments involved My question is: which "tools" would you advise me? a ) create a new page OUT of WordPress with PHP? + mysqli? b ) create a new page OUT of WordPress with JAVASCRIPT? c ) create a new page WITH of WordPress with existing PLUGIN? nope, I couldn't find any suitable! d ) any other suggestion? Having done my research, many suggestions and recommendations show up...but I'd like your opinion according to your own experience. Txs
  23. Hi Thanks for the great tutorial! In medias res - just the way I like it. I thought I'd post questions as they come up, for a starter here's this: "Another convention is that getter and setter names should match the property names" Is this really just a convention or the class would not work at all otherwise? In other words do I need "var $name;" in order to set (and get) the value of "$this->name"?
  24. A question about MySQL beginners course, part of connecting mysql with php, the video was very quickly and i didnt understand well. 1) Is there any simple way to connect a user to a database without such apps such cPanel? (from MyAdmin) 2)You told - "I am just using cPanel to connect a user with a database". Is there some free cPanel alternative that would work good on both mac and windows operating systems? For example i found some alternatives but on the download page i didnt see macos supported.
  25. Hi i have encountered one quirk in PHP, and I was wandering if anyone can explain it to me. So writing this code gives me infinite loop public static function find_this_query($sql){ global $Database; $result_set = $Database->queryFunction($sql); $theObjectArray = array(); $var = $result_set->fetch_assoc(); // I put the whole array in $var while($row = $var){ // and then I put that here // some code here } return $theObjectArray; } Buuuut this doesnt public static function find_this_query($sql){ global $Database; $result_set = $Database->queryFunction($sql); $theObjectArray = array(); while($row = $result_set->fetch_assoc()){ // here I just put method and everything works fine // some code here } return $theObjectArray; } So I just wanna know why. Thanks nerdzzzz!
×
×
  • Create New...