initial commit

This commit is contained in:
Luke Ogburn
2019-03-30 23:03:43 -04:00
commit 3d9e0c7717
29 changed files with 740 additions and 0 deletions

32
user/index.php Normal file
View File

@@ -0,0 +1,32 @@
<?php
require "/home/lukeuxao/public_html/500/global.php";
?>
<!DOCTYPE html>
<html>
<head>
<?php
$title = "User Page";
$css = "user";
require $root."/res/head.php";
?>
</head>
<body>
<?php require $root."/res/top.php"; ?>
<h2><?=$current_user?></h3>
<?php
$stmt = $conn->prepare("SELECT COUNT(id) FROM posts WHERE user_id = :usr");
$stmt->bindParam(":usr", $current_userID);
$stmt->execute();
$res = $stmt->fetch(PDO::FETCH_ASSOC);
$times = $res["COUNT(id)"];
if($times == 1){
$times = "once";
}else{
$times = $times." times";
}
?>
<p>You have written <?=$times?> so far.</p>
<a href=signin.php>Switch accounts</a><br>
<a href=signout.php>Log out</a>
</body>
</html>