Jump to content

cyberRobot

Moderators
  • Content Count

    3,041
  • Joined

  • Last visited

  • Days Won

    27

cyberRobot last won the day on October 22 2020

cyberRobot had the most liked content!

Community Reputation

126 Excellent

About cyberRobot

  • Rank
    Much to Learn

Contact Methods

  • Website URL
    http://www.cyberscorpion.com/

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

86,854 profile views
  1. Those are just sample category names. Yours should be +----+--------------+-----------------+ | id | topic_title | topic_parent_id | +----+--------------+-----------------+ | 1 | Authors | 0 | | 2 | General | 0 | | 3 | People | 0 | | 4 | Celebrities | 3 | | 5 | Historical | 3 | +----+--------------+-----------------+ ...etc.
  2. All you should need is the id, topic_title, and topic_parent_id. Where Barand uses "service", you would use "topic_title". Where Barand uses "parent", you would use "topic_parent_id".
  3. As Barand mentioned, the code (as posted) is technically fine. Just be aware that the missing semi-colon after the line that outputs "Green" may cause errors if you add more code to the PHP block after the final echo statement.
  4. No problem. Glad you got everything figured out!
  5. Does the query return an error? If so, what's the error? Or does the page display "New record has been added successfully !"?
  6. When naming the quantity fields, I would use the row ID from the database as the key that goes between the square brackets. If your "Cherry" product's ID is 5, for example, the input tag for the quantity field in the HTML code would look like this: <input type='number' min='0' max='10' name='quantity[5]' ... That way you don't need to pass the product names and prices with the form submission. And you don't need to worry about the customer trying to change a price on you in the form. Note that the "readonly" flag is very easy to bypass for someone who's familiar with the Console feat
  7. You could potentially try setting a session variable (or cookie in PHP) and reload the page. If the session variable (or cookie) doesn't exists after the page reloads, you could display an error message to the user.
  8. In case it helps, the PHP manual mentions the alternative functions to use in the place of your various "mysql_" calls. You just need to look the functions up in the manual. For example, the following page talks about mysql_connect and the potential alternatives: https://www.php.net/manual/en/function.mysql-connect.php As gw1500se mentioned, the PDO alternative is going to be the way to go. Also note that the following page provides more information about migrating from PHP 5.6 to 7: https://www.php.net/manual/en/migration70.php Of course, there may be other changes you'l
  9. cyberRobot

    Hello!

    Hello and welcome!
  10. Just to make sure, for benanamen's suggestion, you should replace the following line: if(isset($_POST["submit"])) With the line below. Note that I removed the curly / smart quotes around POST. if($_SERVER['REQUEST_METHOD'] == 'POST') I would also add some sort of debug code to see if the if test is working. For example, if($_SERVER['REQUEST_METHOD'] == 'POST') { echo '<br>form submission detected'; Does the script display "form submission detected" after submitting the form? Also, if the script still doesn't work as you expect, please post your most recent code.
  11. What was the problem that you noticed? Are you getting an error? If so, what is it? If you haven't done so already, it may help to set PHP to display all errors. You could add the following code to the top of login.php: //REPORT ALL PHP ERRORS error_reporting(E_ALL); ini_set('display_errors', 1); Just remember to remove the code when you are done debugging the script.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.