I do md5 to user password before saving to db, then I take user input and md5 it and save it in a variable but when I echo the user input variable its generated md5 is different from the one saved in db even though same character is used, I don't understand.
when saving to db
$query = "insert into customer (name, email, password, contact) values ('$name', '$email', MD5('$passw'), '$contact');";
When verifying:
if ($row = mysqli_fetch_assoc($result))
{
$dbname = $row["email"];
$dbpass = $row["password"];
}
$mdrpass = md5($lpass);
if ($lemail == $dbname && $mdrpass == $dbpass)
{
echo "SUCCESS";
}
else
{
echo "failed";
}