This commit is contained in:
ui0ppk 2023-02-05 11:20:50 +02:00
commit 3c7fea1007
10 changed files with 77 additions and 3 deletions

View File

@ -122,4 +122,8 @@ $getitstarted->header();
</div>
</main>
</body>
</html>
</html>
<?php
$getitstarted = new PartyStarter;
$getitstarted->footer();
?>

View File

@ -85,6 +85,9 @@ class PartyStarter {
</div>
</nav>';
}
function footer() {
echo "<hr>hi this is footer";
}
}
?>

View File

@ -68,3 +68,7 @@ $getitstarted->header();
</main>
</body>
</html>
<?php
$getitstarted = new PartyStarter;
$getitstarted->footer();
?>

View File

@ -130,4 +130,8 @@ $getitstarted->header();
</div>
</main>
</body>
</html>
</html>
<?php
$getitstarted = new PartyStarter;
$getitstarted->footer();
?>

View File

@ -107,3 +107,7 @@ $getitstarted->header();
</main>
</body>
</html>
<?php
$getitstarted = new PartyStarter;
$getitstarted->footer();
?>

View File

@ -41,4 +41,4 @@ src="https://www.youtube.com/embed/<?php echo $youtubevideo; ?>">
</div>
</div>
</div>
</body>
</body>

43
item.php Normal file
View File

@ -0,0 +1,43 @@
<?php
session_start();
require_once 'core/classes.php';
require_once 'core/classes/user.php';
if(isset($_SESSION['user'])) {
$user = new User($con, $_SESSION['user']);
}
if(!isset($_GET["id"])) {
header("Location: ?id=".$_SESSION['user']);
} else {
$id = (int)$_GET["id"];
}
$q = $con->prepare("SELECT * FROM catalog WHERE id = :id");
$q->bindParam(':id',$id,PDO::PARAM_INT);
$q->execute();
$item = $q->fetch();
if(!$item) {
die("go fuck yourself (can't find item)"); // todo: redirect to 404
}
?>
<!DOCTYPE html>
<html data-bs-theme="dark">
<head>
<?php
$getitstarted = new PartyStarter;
$getitstarted->header();
?>
</head>
<title><?php echo htmlspecialchars($item["name"]); ?> | <?php echo $sitename; ?></title>
<body>
<h1>yes i am still not hired to make html</h1>
<h1>this item is called <?php echo htmlspecialchars($item["name"]); ?></h1>
<h1>with id <?php echo (int)htmlspecialchars($item["id"]); ?></h1>
<h1>and he costs $<?php echo (int)htmlspecialchars($item["price"]); ?></h1>
<p>thats all i have to say</p>
</body>
</html>
<?php
$getitstarted = new PartyStarter;
$getitstarted->footer();
?>

View File

@ -71,3 +71,7 @@ $thefunfact = json_decode($result);
</div>
</body>
</html>
<?php
$getitstarted = new PartyStarter;
$getitstarted->footer();
?>

View File

@ -94,3 +94,7 @@ $thefunfact = json_decode($result);
</form>
</body>
</html>
<?php
$getitstarted = new PartyStarter;
$getitstarted->footer();
?>

View File

@ -57,3 +57,7 @@ $getitstarted->header();
</main>
</body>
</html>
<?php
$getitstarted = new PartyStarter;
$getitstarted->footer();
?>