Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Educational project? Immediately learn to do more or less correctly .
when registering, we get the login and password from the form, we hash the password.
$login = $_POST['login'];
$hash = password_hash($_POST['password']);
$login = $_POST['login'];
$password = $_POST['password']; // не хешируем
SELECT * FROM users WHERE login = '$login'
if (password_verify($password, $hash_from_db)) {
// пользователь аутентифицирован
} else {
// пара логин/пароль неверная
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question