kann mir jemand aus diesem Problem helfen? ich erhalte Fehler von ‚call of undefined function hash_equals()
‘ hier mein Code:PHP-Aufruf der undefinierten Funktion hash_equals()
$username = 'Admin';
$password = 'sample1Pasword';
$dbh = new PDO('mysql:host=localhost;dbname=test', $USER, $PASSWORD);
$sth = $dbh->prepare('
SELECT
hash
FROM users
WHERE
username = :username
LIMIT 1
');
$sth->bindParam(':username', $username);
$sth->execute();
$user = $sth->fetch(PDO::FETCH_OBJ);
// Hashing the password with its hash as the salt returns the same hash
if (hash_equals($user->hash, crypt($password, $user->hash))) {
// Ok!
}else{
//user not found
}
Ich weiß nicht, was los ist, ich für diese Funktion nur die Suche, aber es givin mir stattdessen ein Problem. Entschuldigung für mein schlechtes Englisch. Vielen Dank!
Was ist deine PHP-Version? – sectus