17 lines
477 B
PHP
17 lines
477 B
PHP
<?php
|
|
session_start();
|
|
$username = $_POST['username'];
|
|
$password = $_POST['password'];
|
|
|
|
|
|
$pdo = new PDO('mysql:host=localhost;dbname=web', 'webstuff', 'Schei// auf Pa$$w0rter!');
|
|
$statement = $pdo->prepare('SELECT id, name, authentication_algorithm, authentication_string FROM users WHERE name = :username;');
|
|
$result = $statement->execute(array('username' => $username));
|
|
if ($result) {
|
|
//existing user name
|
|
print_r($statement->fetch());
|
|
} else {
|
|
//wrong user name
|
|
}
|
|
?>
|