Page is a not externally linkable
oilyflutesalad - 12:01 pm on Nov 23, 2008 (gmt 0)
When a user registers, their information is stored in a database. On the login page they enter the username and password, which is then checked against the information held in the database before setting a cookie. Passwords are stored base64 encoded. Here's the code I'm having problems with: Later on in the script, for testing purposes, I echoed both $pass and $pass2, and they match up fine. However the script still says the passwords don't match... Any ideas? This has been baffling me for hours! Thanks for your help.
I've spent the last few hours writing a login script for my website, but I've been stumped on a problem verifying passwords...
$pass = $_POST['pass'];
$pass = strip_tags($pass);
$pass = stripslashes($pass);
$pass = mysql_real_escape_string($pass);
$pass = base64_encode($pass);
$pass2 = $array['password'];
if ($pass == $pass2)
{
echo "password matches";
}
else
{
echo "password doesn't match";
}