Jump to content
Larry Ullman's Book Forums


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About dalmation8429

  • Rank
  1. OK, echo n12br(file_get_contents($file)) works for both of them now. Both login.php and register.php can display what's currently in the text file. One of the periods got lost in the third line. Must have accidentally deleted one somehow. And now even better news. Login.php finally worked! It says "You are now logged in!" Not exactly sure what made it work (the period wasn't always a problem--see first post), but it works now. Anyhow, thanks for the help HartleySan. Now I can happily continue on in the book
  2. How would I go about getting the values in the text file? I tried using this code in login.php, echo nl2br(file_get_contents($file)) ...but nothing happened. It returned a blank line where the output should have been. Out of curiosity, I tried the code in register.php and it showed everything in the text file perfectly. I just don't get it. What is it about my login.php that's making it not acknowledge my text file at all?
  3. @HartleySan Thanks. I inserted both strlen and echo into login. php. The results showed the same thing as what was put in with register.php. There's nothing extra. This is the code I used: print strlen($_POST['username'])."<br>"; print strlen(md5(trim($_POST['password'])))."<br>"; echo md5(trim($_POST['password']))."<br>"; echo $_POST['username'];
  4. Hi everyone. I've done everything I could think of to get Script 11.8 to work, but I keep getting the error message 'The username and password you entered do not match those on file'. The users.txt is where it should be (because it worked fine for register.php) and the script is almost exactly how it is in the book. I'm using the same user names and passwords as well. Is this happening because I'm on a Mac? Oh, I'm on PHP 5.3.6 and use XAMPP. <?php // Script 11.8 - login.php $file = '../users/users.txt'; if ($_SERVER['REQUEST_METHOD'] == 'POST') { // Handle the form. $loggedin = F
  • Create New...