threadr.lostcave.ddnss.de/threadr/login/redirect.php

17 lines
477 B
PHP
Raw Normal View History

2020-02-19 15:50:13 +01:00
<?php
session_start();
$username = $_POST['username'];
$password = $_POST['password'];
$pdo = new PDO('mysql:host=localhost;dbname=web', 'webstuff', 'Schei// auf Pa$$w0rter!');
2020-02-20 01:02:31 +01:00
$statement = $pdo->prepare('SELECT id, name, authentication_algorithm, authentication_string FROM users WHERE name = :username;');
2020-02-19 15:50:13 +01:00
$result = $statement->execute(array('username' => $username));
2020-02-20 01:02:31 +01:00
if ($result) {
//existing user name
print_r($statement->fetch());
} else {
//wrong user name
}
2020-02-19 15:50:13 +01:00
?>