Hey Everyone,
I am using Php cyrpt() to hide passwords, but the comparison is not working.
If i simply use this code:
$password = crypt("test");
$input = 'test';
if ( crypt($input, $password) == $password )
{
echo "ok";
}
else
{
echo "no";
}
Not a problem....it comes back ok. But
$username = 'test';
$password = 'password';
$find_password = "select password from fod_members where id = $find_user_row[id]";
$find_password_result = mysql_query($find_password);
$find_password_row = mysql_fetch_array($find_password_result);
echo $find_password_row[password];
if ( crypt($password, $find_password_row[password]) == $find_password_row[password])
{
echo "ok";
}
else
{
echo "no";
}
I echoed the password i got from the database to chekc and see that it is right, and it does output the saved cyrpted password from when i put it there with php.
It nevers prints ok, thus the passwords are different..but there not.
anyone help me with why?