have to
This commit is contained in:
parent
fba0c6f24f
commit
5d6615709d
39
user.php
39
user.php
|
|
@ -0,0 +1,39 @@
|
|||
<?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" style="width: 100%;">
|
||||
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue