step 1: Use PHP bbcode tags around your code. much easier to read for those that try to help.
Step 0: Clear out your passwords before posting your code. (Unless you intentionally put root/root in there, in which case good on you.)
The code appears valid, if somewhat redundant. My first thought though is ‘do you have multiple rows in your database with the same username and different passwords’. The reason being this:
If you pull multiple records with this query, that code will ensure that only the LAST record is used for comparison. (because it will overwrite $dbusername and $dbpassword every time). You may have accidentally MD5’d an MD5 string, which is why the password expects the hash. Take a look in your database and ensure that you only have 1 record for this name, and that it’s password is the hash string you expect.
Apparently so. I’m not sure how to fix the issue, I figured the login.php wasn’t requesting the right password, or it’s not encoding the password before sending it. Any ideas?
The query returns the wrong password? So there was an error when you initially created the account. Try creating a new account and see if the password is entered into the database as the correct hash. (It should be.)
I think I see the cause of my frustrations. the “./” always the last place you look, I figured it had something to do with the PHP and not the original piece I coded.
I’ll check it out and see if it works.
Sorry if I was being frustrating today guys! Thanks for putting me in the right direction.