Fixed detection of wrong user name

master
BodgeMaster 2020-02-20 19:44:21 +01:00
parent ab3691ade6
commit 4779d901c2
1 changed files with 1 additions and 1 deletions

View File

@ -7,7 +7,7 @@ $password = $_POST['password'];
$pdo = new PDO('mysql:host=localhost;dbname=web', 'webstuff', 'Schei// auf Pa$$w0rter!'); $pdo = new PDO('mysql:host=localhost;dbname=web', 'webstuff', 'Schei// auf Pa$$w0rter!');
$statement = $pdo->prepare('SELECT id, authentication_algorithm, authentication_salt, authentication_string FROM users WHERE name = :username;'); $statement = $pdo->prepare('SELECT id, authentication_algorithm, authentication_salt, authentication_string FROM users WHERE name = :username;');
$result = $statement->execute(array('username' => $username)); $result = $statement->execute(array('username' => $username));
if ($result) { if ($statement->rowCount() > 0) {
//existing user name //existing user name
$dbentry = $statement->fetch(); $dbentry = $statement->fetch();
//chechk for correct password //chechk for correct password