-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpages.php
70 lines (38 loc) · 1.21 KB
/
pages.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
66
67
68
69
70
<html>
<head>
<title>Welcome to Malala Yousfazia</title>
<link rel="stylesheet" href="style.css" media="all">
</head>
<body>
<div><?php include("includes/header.php"); ?></div>
<div><?php include("includes/navbar.php"); ?></div>
<div id="main_content">
<?php
include("includes/connect.php");
if(isset($_GET['id'])){
$page_id = $_GET['id'];
$select_query = "select * from posts where post_id='$page_id'";
$run_query = mysql_query($select_query);
while($row=mysql_fetch_array($run_query)){
$post_id = $row['post_id'];
$post_title = $row['post_title'];
$post_date = $row['post_date'];
$post_author = $row['post_author'];
$post_image = $row['post_image'];
$post_content =$row['post_content'];
?>
<h2>
<a href="pages.php?id=<?php echo $post_id; ?>">
<?php echo $post_title; ?>
</a>
</h2>
<p align="left">Published on: <b><?php echo $post_date; ?></b></p>
<p align="right">Posted by: <b><?php echo $post_author; ?></b></p>
<center><img src="images/<?php echo $post_image; ?>" width="500" height="300" /></center>
<p align="justify"><?php echo $post_content; ?></p>
<?php } }?>
</div>
<div><?php include("includes/sidebar.php"); ?></div>
<div id="footer">Footer</div>
</body>
</html>