Add files via upload

This commit is contained in:
NikolaiDerDeutsche
2023-12-03 00:06:49 +01:00
committed by GitHub
commit ebe454e805
6 changed files with 183 additions and 0 deletions

51
profile.php Normal file
View File

@@ -0,0 +1,51 @@
<?php
include "connectionDB.php";
include "checkUser.php";
if(!isset($_GET["id"])) {
header("Location: /index.php");
}
else {
$id = $_GET["id"];
$get_user_id->execute([$id]);
$get_posts_count->execute([$id]);
$user = $get_user_id->fetch();
$count = $get_posts_count->fetch();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/global.css">
<title>TinyTalkHub</title>
</head>
<body>
<h1><a href="/index.php">TinyTalkHub</a></h1>
<div class="info-user-wrap">
<h3>Short info about user</h3>
<p>Username: <?php echo $user["username"] ?></p>
<p>Number of posts: <?php echo $count[0] ?></p>
</div>
<div>
<?php
$get_user_posts->execute([$id]);
?>
<?php foreach($get_user_posts->fetchAll() as $row) { ?>
<div class="wrap-posts">
<div class="wrap-post-info">
<p>
Created by <?php echo $user["username"] ?>
</p>
<p> <?php echo $row["date"] ?>
</p>
</div>
<div class="wrap-post-content">
<p> <?php echo $row["content"] ?></p>
</div>
</div>
<?php }?>
</div>
</body>
</html>