The first thing I'd check is:
- Does the authentication work at all?
If you enter a name and password, does it indeed check the database?
The best way to do this is to put echo statements all over the place, printing out where they are.
So when you are about to connect to the database, put
echo "connecting to the database"
and when you set the access rights, print "setting accessrights"
that will allow you to see just what your program is doing. It may be skipping some section completely.
Second, print, print and print some more.
print the user name and password that you get from the login form, and print each username/password you compare it to. Then, print a message when there's a match.
You can't guess what's going on inside your script, you need to see it, so print it :-)
It is allways a good idea to build in little status messages like this all over your program:
if (DEBUG)
{
echo "Main Login procedure<BR>";
echo "username: $username<BR>";
echo "password: $password<BR>";
}
that way, when you have a problem, you can define DEBUG as 1 instead of 0, instantly activating all these messages, showing you exactly what contains what and where.