Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


cyberRobot last won the day on October 22

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,385 profile views
  1. 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.
  2. Try adding echo before the variable.
  3. 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.
  4. 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
  5. 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 ... )
  6. What does your form code look like?
  7. 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
  8. 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>';
  9. It sounds like you are trying to use an array key that doesn't exist. Are you using an associative array, like your first post above shows. Or are you using a numeric array, like benanamen's code uses? Your choice will affect how you use the keys within the loop that outputs the form fields.
  10. Where are you stuck? Creating the array or using the array to display the form? What have you done so far? What does your current code look like?
  11. Be default, the display property for <div> tags is set to "block". This means that a line break is added before and after the <div> tag. Since it looks like you are trying to display a series of images with a text block below the photo, you could wrap both the image and the <div> tag with a parent <div> tag. Then using CSS to, you could float that parent div tag to the left. For code examples, you could run a Google search for "css image gallery with captions".
  12. It sounds like something went wrong with the database query that resulted in $tweets / $tweet. Have you tried enabling the error reporter for PDO? More information can be found here: https://www.php.net/manual/en/pdo.error-handling.php
  • 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.