false;
}
function userdata($login, $password, $salt, $pdo) {
$connect = $pdo->prepare("SELECT * FROM alter_users WHERE name = :login");
$connect->bindParam(":login",$login);
$connect->execute();
if ($connect->rowCount() <= 0) return false;
$userdata = $connect->fetch(PDO::FETCH_ASSOC);
if (!password_verify(urldecode($password), $userdata['password'])) return false;
if ($userdata['salt'] != $salt) return false;
return $userdata;
}
$login = $_SESSION['login'];
$password = $_SESSION['password'];
$salt = $_SESSION['salt'];
if (session($login, $password, $salt) !== false) {
$userdata = userdata($login, $password, $salt, $pdo);
} else {
$userdata = false;
}
Здесь?
Обсуждают сегодня