Jump to content
Larry Ullman's Book Forums

Chapter 15 Login.php Cannot Log In To Auction Site


Recommended Posts

I have downloaded the entire auction application from Chapter 15. All my database connections work fine and my application does not throw any errors that I know of, but I cannot login to the site. I have tried different usernames and passwords, but none of them work. I keep getting the error message "The submitted values do not match what is on file"

 

I did however comment out the call to the JavaScript file login.js which contains an AJAX call to another login.php located in the AJAX folder. this allowed me to receive a successful login message, so I know at the very least my application is connecting to the database and reading the username and password correctly. It appears something in the AJAX call to the PHP script is not working.

 

I am using XAMPP and NetBeans. Could it be I need to use a certain version of PHP? I believe I am using 5.4 but I can double check. Any advice you can give would help

 

Thanks

Link to comment
Share on other sites

It's likely not the PHP version. I'd first make sure you're running this directly in a browser, not through NetBeans, to rule that out. Next, I'd walk the process back: confirm what values get submitted via Ajax, confirm what values are received by PHP, confirm the query being executed, confirm the query results by executing that query using another interface (e.g., the mysql command line client). 

  • Upvote 1
Link to comment
Share on other sites

Hi Larry, I got it working now. The problem was my mysqli_connect.php was in the web root directory, but the ajax/login.php script could not read it from there. Nor could any of the other php scripts in the ajax folder. I changed the path to be require('../../mysqli_connect.php'); instead of require('../mysqli_connect.php');

 

Surprisingly NetBeans built in Console did not show the error but FireBug in Mozilla did.

NetBeans might not be the best IDE it seems.

 

I have really enjoyed your books Larry. Thanks for everything.

 

Chris

 

 

Link to comment
Share on other sites

 Share

×
×
  • Create New...