-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathview.php
More file actions
40 lines (40 loc) · 1.52 KB
/
Copy pathview.php
File metadata and controls
40 lines (40 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple Blog</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
</head>
<body>
<header class="p-4 bg-dark text-center">
<h1><a href="index.php" class="text-light text-decoration-none">Simple Blog</a></h1>
</header>
<div class="post-list mt-5">
<div class="container">
<?php
$id = $_GET['id'];
if ($id) {
include("connect.php");
$sqlSelect = "SELECT * FROM posts WHERE id = $id";
$result = mysqli_query($conn,$sqlSelect);
while ($data = mysqli_fetch_array($result)) {
?>
<div class="post bg-light p-4 mt-5">
<h1><?php echo $data['title']; ?></h1>
<p><?php echo $data['date']; ?> </p>
<p><?php echo $data['content']; ?> </p>
</div>
<?php
}
}else{
echo "No post found";
}
?>
</div>
</div>
<div class="footer bg-dark p-4 mt-4">
<a href="admin/index.php" class="text-light">Admin Panel</a>
</div>
</body>
</html>