Hi all,
First post on here! Hope someone can help
On my website, I have a register form which uses password_hash to encrypt passwords. I am trying to make a login form which checks what the user enters against the encrypted password.
My setup for login: login.html is the front end and userlogin.php is the backend.
The code I currently have but doesnât work is:
[php] //check password against encryption method
$password = $_POST[âpasswordâ];
$secretpassword = password_hash($password, PASSWORD_BCRYPT);
//check for required fields from the form
if(isset($_POST["username"], $_POST["password"])){
if(password_verify($password, $securepassword)){
header("Location: userlogin.html");
exit; }
}[/php]