warenkorb done
parent
2ef6a4a062
commit
4dc2160df5
|
@ -52,7 +52,7 @@
|
|||
<?php
|
||||
session_start();
|
||||
if(isset($_SESSION['eingeloggt']) && $_SESSION['eingeloggt'] == 1 ){
|
||||
require_once "warenkorb.php";
|
||||
require_once "reservierung.php";
|
||||
}else{
|
||||
echo '
|
||||
|
||||
|
@ -70,7 +70,7 @@
|
|||
<hr>
|
||||
|
||||
<div>
|
||||
<form class="anmeldung-überschriften" accept-charset="UTF-8" action="warenkorb.php" method="POST">
|
||||
<form class="anmeldung-überschriften" accept-charset="UTF-8" action="anmeldesystem_warenkorb.php" method="POST">
|
||||
Karten-ID <span id="question-mark">
|
||||
<svg width="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
||||
<path d="M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
<?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){
|
||||
|
||||
$_SESSION['eingeloggt'] = 1;
|
||||
header("Location: reservierung.php");
|
||||
}else if($zeile['COUNT(*)'] > 0){
|
||||
header("Location: passwort_stimmt_nicht.php");
|
||||
}else{
|
||||
header("Location: benutzer_existiert_nicht.php");
|
||||
}
|
||||
|
||||
}else{
|
||||
header("Location: 404.html");
|
||||
}
|
||||
|
||||
?>
|
Loading…
Reference in New Issue