anmeldesystem wurde geändert
parent
5ba709c313
commit
02619b31b2
|
@ -53,7 +53,7 @@
|
|||
session_start();
|
||||
|
||||
if(isset($_SESSION['eingeloggt']) && $_SESSION['eingeloggt'] == 1 ){
|
||||
require_once "meinebuecher.php";
|
||||
require_once "anmeldesystem_meinebuecher.php";
|
||||
}else{
|
||||
echo '
|
||||
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
<?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");
|
||||
}
|
||||
|
||||
?>
|
|
@ -51,26 +51,7 @@
|
|||
</header>
|
||||
<?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);
|
||||
|
||||
if($row['COUNT(*)'] > 0){
|
||||
|
||||
|
@ -222,9 +203,7 @@ if(isset($_POST['submit'])){
|
|||
}else{
|
||||
header("Location: benutzer_existiert_nicht.php");
|
||||
}
|
||||
}else{
|
||||
header("Location: 404.html");
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
|
Loading…
Reference in New Issue