Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


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

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

86,689 profile views
  1. 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.
  2. 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
  3. cyberRobot


    Hello and welcome!
  4. 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.
  5. 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.
  6. Try adding some echo statements to your if constructs where you test the form input. That way you can make sure the code is executing properly. For example, you could try something like this: if(isset($_POST["submit"])) { echo '<br>form submission detected'; //process form if($_POST["username"] == "" || $_POST["password"] == ""){ echo '<br>either username or password is blank'; Note that you'll want to comment out or remove the session code in your login_view.php file to avoid errors caused by the above echo statements. That session code isn't n
  7. Try adding the following echo statement inside your if construct to see what $_POST contains: if (isset($_POST['login'])) { echo '<pre>' . print_r($_POST, true) . '</pre>'; After adding the line, try submitting the form, but don't use a real login. Just enter random characters. What does the output look like? Note that you're looking for output like the following (please don't post real usernames/passwords): Array ( [tpw] => sdflaje ... )
  8. What does your form code look like?
  9. Which "index" does the error message refer to? What is the error message? Side note: if you're not doing so already, you'll want to look into password security. More information can be found here: https://www.php.net/manual/en/faq.passwords.php
  10. Adding the following line of code inside your foreach loop may help with understanding what's inside $value: echo '<pre>' . print_r($value, true) . '</pre>';
  • 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.