이 문제를 도와 줄 수 있습니까? 내가 여기에 '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