I've been working through PHP, MySQL, Javascript & CSS 2nd edition by Robert Nixon (O'Reilly 2012). I've managed to set up a database on my WAMP server (Zend server).
The book then shows how to authenticate a username and password. i managed to create a few usernames with passwords which have been added to my database successfully. I know because I connected to the database, read the result of a SELECT query and echo 'd them out to the browser.
When I then try to login with authentication here:
if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) {....perform database query and compare username/password....}
none of my usernames and passwords work. The window 'Authentication Required' pops up again in both Firefox and IE. The PHP code isn't getting past the if statement (I've tried sending output to the browser immediately before and after the if statement) so it seems that the username and password entered are not being passed to the PHP server.
I made sure that 'localhost' is authorized specifically on Firefox, but still no success.
Any suggestions would be welcome.
Gary