warenkorb done

master
GhadaA98 2023-06-14 20:22:44 +02:00
parent 2ef6a4a062
commit 4dc2160df5
2 changed files with 38 additions and 2 deletions

View File

@ -52,7 +52,7 @@
<?php <?php
session_start(); session_start();
if(isset($_SESSION['eingeloggt']) && $_SESSION['eingeloggt'] == 1 ){ if(isset($_SESSION['eingeloggt']) && $_SESSION['eingeloggt'] == 1 ){
require_once "warenkorb.php"; require_once "reservierung.php";
}else{ }else{
echo ' echo '
@ -70,7 +70,7 @@
<hr> <hr>
<div> <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"> Karten-ID <span id="question-mark">
<svg width="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> <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 <path d="M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256

View File

@ -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");
}
?>