grublox/error.php

40 lines
989 B
PHP

<?php
session_start();
require_once 'core/classes.php';
require_once 'core/classes/user.php';
if(isset($_SESSION['user'])) {
$user = new User($con, $_SESSION['user']);
}
// some shitty code by nolanwhy
// yes i coded all of this inside github editor
if(!isset($_GET["id"])) {
header("Location: ?id=".$_SESSION['user']);
} else {
$id = (int)$_GET["id"];
}
$q = $con->prepare("SELECT * FROM users WHERE id = :id");
$q->bindParam(':id',$id,PDO::PARAM_INT);
$q->execute();
$requestUser = $q->fetch();
if(!$requestUser) {
die("go fuck yourself (can't find user)"); // todo: redirect to 404
}
?>
<!DOCTYPE html>
<html data-bs-theme="dark">
<head>
<?php
$getitstarted = new PartyStarter;
$getitstarted->header();
?>
</head>
<title><?php echo $sitename; ?> | <?php echo htmlspecialchars($requestUser["username"]); ?></title>
<body>
<main class="container mx-auto position-absolute top-50 start-50 translate-middle text-center" style="width: 100%;">
dssda
</main>
</body>
</html>