91 lines
2.3 KiB
PHP
Executable File
91 lines
2.3 KiB
PHP
Executable File
<?php include('config.php'); ?>
|
|
<?php
|
|
session_start();
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<style>
|
|
table {
|
|
font-family: arial, sans-serif;
|
|
border-collapse: collapse;
|
|
width: 70%;
|
|
}
|
|
|
|
td, th {
|
|
border: 1px solid #dddddd;
|
|
text-align: left;
|
|
padding: 8px;
|
|
}
|
|
|
|
tr:nth-child(even) {
|
|
background-color: #dddddd;
|
|
}
|
|
|
|
.hnlink {
|
|
text-decoration:none;
|
|
color: #09BC8A;
|
|
}
|
|
.hntable {
|
|
padding-top: 50px;
|
|
padding-right: 30px;
|
|
padding-bottom: 50px;
|
|
padding-left: 80px;
|
|
}
|
|
#remarkbox-div {
|
|
padding-top: 0px;
|
|
padding-right: 80px;
|
|
padding-bottom: 50px;
|
|
padding-left: 80px
|
|
}
|
|
</style>
|
|
<meta charset="utf-8">
|
|
<title><?= $siteName; ?></title>
|
|
<link href="account/style.css" rel="stylesheet" type="text/css">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css" integrity="sha512-xh6O/CkQoPOWDdYTDqeRdPCVd1SpvCA9XXcUnZS2FmJNp1coAFzvtCN9BmamE+4aHK8yyUHUSCcJHgXloTyT2A==" crossorigin="anonymous" referrerpolicy="no-referrer">
|
|
</head>
|
|
<body class="loggedin">
|
|
<nav class="navtop">
|
|
<div>
|
|
<h1><?= $siteName; ?></h1>
|
|
<a href="account/index.php"><i class="fas fa-gear"></i>Account</a>
|
|
<a href="submit.php"><i class="fas fa-pencil"></i>Post</a>
|
|
<a href="users.php"><i class="fas fa-users"></i>Users</a>
|
|
<a href="account/logout.php"><i class="fas fa-sign-out-alt"></i>Logout</a>
|
|
</div>
|
|
</nav>
|
|
|
|
<br>
|
|
<center>
|
|
|
|
<?php $theurl = '"com.php?postid='.htmlspecialchars($_GET['postid']).'"'; ?>
|
|
<form action=<?=$theurl;?> method="post">
|
|
<input type="text" name="comment">
|
|
<input type="submit" value="Comment">
|
|
</form>
|
|
</center><br><br>
|
|
<?php
|
|
|
|
// Create connection
|
|
$conn = new mysqli($servername, $username, $password, $dbname);
|
|
// Check connection
|
|
if ($conn->connect_error) {
|
|
die("Connection failed: " . $conn->connect_error);
|
|
}
|
|
|
|
$quersy = $conn->query("SELECT * FROM comments WHERE postid = '".htmlspecialchars($_GET['postid'])."' ORDER BY id DESC");
|
|
|
|
// $conn->query($query)
|
|
|
|
// $conn->query("SELECT * FROM users");
|
|
|
|
while($rows = mysqli_fetch_assoc($quersy)) {
|
|
print "<center><a class='hnlink' href='account/userprofile.php?user=".htmlspecialchars($rows['commenter'])."'>".htmlspecialchars($rows['commenter'])."</a><br>".htmlspecialchars($rows['comment'])."</center>";
|
|
}
|
|
|
|
|
|
?>
|
|
|
|
</body>
|
|
</html>
|