28 lines
808 B
PHP
28 lines
808 B
PHP
<?php session_start();
|
|
$db_link = mysqli_connect('localhost', 'web_b-3', 'een7Ao6s', 'bibliothek_candle', '3306');
|
|
|
|
function runSQL($sql){
|
|
global $db_link;
|
|
$db_res = mysqli_query($db_link, $sql);
|
|
if(!$db_res){
|
|
header("Location: 404.html");
|
|
exit;
|
|
}
|
|
return $db_res;
|
|
}
|
|
|
|
if(isset($_POST['submit'])){
|
|
$kartenid = $_POST['karten-id'];
|
|
$passwort = $_POST['password'];
|
|
|
|
$existiert = runSQL("SELECT COUNT(*) FROM `benutzer` WHERE `KartenID` = '$kartenid' and `Passwort` = '$passwort'");
|
|
$row = mysqli_fetch_array($existiert);
|
|
$karteexistiert = runSQL("SELECT COUNT(*) FROM `benutzer` WHERE `KartenID` = '$kartenid'");
|
|
$zeile = mysqli_fetch_array($karteexistiert);
|
|
header("Location: meinebuecher.php");
|
|
|
|
}else{
|
|
header("Location: 404.html");
|
|
}
|
|
|
|
?>
|