この問題を解決するには? は、私はここで「call of undefined function hash_equals()
」 のエラーを取得しています私のコードです:定義されていない関数hash_equals()のPHP呼び出し
$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
}
私は何が起こっているのを知って、私はちょうどこの機能を探したが、それは代わりに私の問題を引けるいけません。 私の悪い英語のために申し訳ありません。ありがとうございました! the documentationから
あなたのPHPのバージョンは何ですか? – sectus