我想在登录时使用 MD5 对数据库中的注册密码进行哈希处理,但问题是在注册过程中密码被哈希处理但在登录时系统工作,因为这是不正确的密码
注册.php
//ADD MD5 hash to the password
$db_pass=md5($pass1);
//************Insert all the user's input to the database**************************//
$query = mysql_query("INSERT INTO user(user_name, first_name, last_name, governorate,
district, village, birth_date, email_address, specialization, password,
registered_date)VALUES('$username', '$firstname', '$lastname', '$governorate',
'$district', '$village', '$bdate', '$email', '$specialization', '$db_pass',
now())") or die("could not insert data");
登录.php
$pass = md5($pass);
$sql=mysql_query( "SELECT user_id, email_address, first_name, user_name FROM user
WHERE email_address='$email'
AND password='$pass'LIMIT 1") or die("error in user table");