Can someone please tell me how i am suppose to verify a hashed password when someone is logging in?
here is my registration code:
$db_password = password_hash($password, PASSWORD_DEFAULT);
// Enter info into the Database.
$info2 = htmlspecialchars($info);
$sql = mysql_query("INSERT INTO users
(first_name, last_name, email_address, username, password, signup_date)
VALUES('$first_name', '$last_name',
'$email_address', '$username',
'$db_password', now())")
or die (mysql_error());
this is my check user code run at login . .
$hash = password_hash($password, PASSWORD_DEFAULT);
// check if the user info validates the db
$sql = mysql_query("SELECT *
FROM users
WHERE username='$username'
AND password='$hash'
AND activated='1'");
$login_check = mysql_num_rows($sql);
i can not figure it out.