-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpage2.php
65 lines (57 loc) · 1.47 KB
/
page2.php
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
require('connection.php');
$id = $_REQUEST['id'];
$query='SELECT * FROM posts WHERE id = '.$id ;
$result= mysqli_query($conn,$query);
$posts = mysqli_fetch_assoc($result);
mysqli_free_result($result);
mysqli_close($conn);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="./page1.css">
<title>
Alter Web Tutorials
</title>
</head>
<body>
<header>
<div class="container">
<div id="branding">
<h1><span>Alter</span> Web Tutorials</h1>
</div>
<nav>
<ul>
<li><a href="page1.php">Posts</a></li>
<li><a href="page3.php">Add Post</a></li>
<li><a href="page5.php">Login</a></li>
</ul>
</nav>
</div>
</header>
<section id="newsletter">
<div class="container">
<h2>Subscribe to our newsletter</h2>
<form>
<input type="email" name="email" placeholder="Enter your email...">
<button type="submit" class="button_1">Subscribe</button>
</form>
</div>
</section>
<section class="container">
<article class="article">
<h1> <?php echo $posts['title'];?> </h1><br>
<p><?php echo $posts['text'];?></p><br><br>
<p><?php echo "Created At :". $posts['time'];?></p>
<a href="page4.php?update_id=<?php echo $posts['id'];?>" class="button">Edit</a>
<br><br><br><br><br><br>
</article>
</section>
<footer>
<p>Alter Web Tutorials © 2019</p>
</footer>
</body>
</html>