0

我正在尝试为我的网站创建一个安全的登录系统,这就是我所拥有的......以及我收到的错误。

<?php

try {
$dbh = new PDO("mysql:host=localhost;dbname=****", "****", "****");
} catch(PDOException $e) {
    echo $e->getMessage();
}

$query = "SELECT * FROM `users` WHERE LOWER(`username`) = :username";
$stmt = $dbh->prepare($query);
$stmt->bindValue(':username', strtolower($_POST['username']));
$stmt->execute();
if ($stmt->rowCount() == 1) {
$row = $stmt->fetch(PDO::FETCH_ASSOC);
require ('includes/blowfish.class.php');
//$bcrypt = crypt(md5(md5("P5IAO".$_POST['password']."AR19W")));
$bcrypt = new Bcrypt(4);
if ($bcrypt->verify($_POST['password'], $row['password'])) {
    echo "Logged in!";
}
} else {
echo 'User NOT found.';
}
?>

我收到这个错误PHP Fatal error: Uncaught exception 'Exception' with message 'bcrypt not supported in this installation. See http://php.net/crypt'

4

0 回答 0