Jump to content
Larry Ullman's Book Forums

Get_Password_Hash Problem


Recommended Posts

Hi there, im going through chapter 4 and have just finished the login form. Everything seems to be working until i tried to log in with a valid email and password, I keep getting The email address and password do not match those on file eror so i looked at the database and saw that the password data was being stored as this

1110011111100101~10101001101001111001100011111111FpC11111011jt11100111100001111100010010101011111111011000010010011111_0000011111010101#11001000X11110100"10100000101010101011010110101111


when it should look like this

e7e57ea9a798ff467043fb6a74e787c4abfd849f5f07d523c858f422a0aab5a


the actual word is Bad222.

Im at a total loss as to whats going on here, I really need some advice

How can i remidy this I gone over and over my code and can't seem to see the problem..... Please help.

Link to comment
Share on other sites

Actually the password should look like neither of those because it should be stored in binary format. It would help to know what versions of PHP and MySQL you're using, per the forum guidelines. Also what did you use to "look" at the database?

Link to comment
Share on other sites

  • 4 weeks later...

Actually the password should look like neither of those because it should be stored in binary format. It would help to know what versions of PHP and MySQL you're using, per the forum guidelines. Also what did you use to "look" at the database?

 

 

What should the password look like when stored in the database?

 

Mine is in this format: cdaf5910b0c01bd05fcfb2e87def350e3dd9caec6a51516629c771d9bb8ffaef

 

The database tables and password functions are taken directly out of the book

 

I am using a testing environment on windows XP Pro SP3.

Apache 2.2.17

MySQL 5.1.56 community

PHP 5.2.17

 

Though my real host has older versions of PHP and MySQL but I am only working with the code from the book on my testing environment for learning purposes.

My testing enviornment has mysqli installed but my real host does not so I will have to use the mysql form of calling the database.

 

The database table for the password is in format varbinary and I am using phpMyAdmin to look at the database.

Link to comment
Share on other sites

I looked at the table with my IDE and it shows --> '

��Y���_���}�5=���jQQf)�q�����

'

 

Bunch of squares and lowercase letters and special characters.. So I guess it is working correctly and somehow phpMyAdmin doesn't show that version but instead the varchar version.

Link to comment
Share on other sites

 Share

×
×
  • Create New...