|
Posted by Erbacher Karl on 02/24/05 18:26
Hello,
I'm trying to hash passwords before saving them to a mySQL database but I am
having a problem. I created three seperate sample users with three different
passwords (password1, password2, password3). When I go back to look at the
table info in the database, it has saved the exact same hash value for all
three users. Any ideas why this might be happening?
The script is very straight forward.
The form that collects the data:
<input type='password' name='password'>
$pass=bin2hex(mhash(MHASH_SHA1, $password));
<input type='hidden' name='pass' value='$pass'>
The file that verifies the data and stores it to the database:
$pass=$_POST['pass'];
INSERT INTO table (username, password) VALUES ('$logname', '$pass');
Thanks,
Cat
Navigation:
[Reply to this message]
|