Candle/warenkorb.php

96 lines
2.8 KiB
PHP
Raw Normal View History

2023-05-26 16:39:10 +02:00
<!DOCTYPE html>
<?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'");
$karteexistiert = runSQL("SELECT COUNT(*) FROM `benutzer` WHERE `KartenID` = '$kartenid'");
$zeile = mysqli_fetch_array($karteexistiert);
$row = mysqli_fetch_array($existiert);
if($row['COUNT(*)'] > 0){
2023-06-05 15:13:50 +02:00
$_SESSION['eingeloggt'] = 1;
2023-05-26 16:39:10 +02:00
echo '<html>
<head>
<meta lang="de"/>
<meta charset="utf-8"/>
<meta name="viewport" content="device=device-width, initial-scaling=1"/>
<link rel="Stylesheet" type="text/css" href="style.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<title>Candle Bibliothek | Warenkorb</title>
<link rel="icon" href="pictures/candle.png">
2023-06-12 10:30:40 +02:00
<script src="notwendiges_laden.js" defer></script>
2023-05-26 16:39:10 +02:00
</head>
<body style="background-color:#987554;">
2023-06-12 10:30:40 +02:00
<header id="header"></header>
2023-05-26 16:39:10 +02:00
<div class="main">
<h1 id="warenkorbHeader">
Warenkorb
</h1>
<div class="containerOfAll">
</div>
<!--Reservieren-->
<div id="reservieren">
<h2 id="ArtikelWarenkorb"> </h2>
<a id="jetztReservieren" href="reservierung.php">Jetzt reservieren</a>
2023-05-26 16:39:10 +02:00
</div>
</div>
<script>
var widthissue = false;
window.addEventListener("resize", function(event) {
if(window.innerWidth > 800 && widthissue) {
widthissue = false
unset()
}
else if(window.innerWidth < 800) widthissue = true;
})
</script>
2023-06-12 11:23:37 +02:00
<nav id="activeid" class="active"></nav>
2023-05-26 16:39:10 +02:00
2023-06-12 10:30:40 +02:00
<footer id="footer" class="fuss" ></footer>
2023-05-26 16:39:10 +02:00
</body>
</html>';
}else if($zeile['COUNT(*)'] > 0){
header("Location: passwort_stimmt_nicht.php");
}else{
header("Location: benutzer_existiert_nicht.php");
}
}else{
2023-06-05 16:57:35 +02:00
header("Location: 404.html");
}
2023-05-26 16:39:10 +02:00
?>