-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch.php
More file actions
57 lines (44 loc) · 1.29 KB
/
search.php
File metadata and controls
57 lines (44 loc) · 1.29 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<html>
<head>
<title>Serach Results</title>
<link rel="stylesheet", href="style.css">
</head>
<body>
<!--This is top area -->
<div id = "top"> <p> Top bar </p> </div>
<!--This is header area -->
<!--This is navigation area -->
<div> <?php include("includes/navbar.php"); ?></div>
<!--This is sidebar area -->
<div class="cont"> <?php include("includes/sidebar.php"); ?></div>
<!--This is post area -->
<div class = "post_body">
<?php
include("includes/connect.php");
if(isset($_GET['submit'])){
$search_id = $_GET['search'];
$query = "select * from posts where post_title like '%$search_id %'";
$run = mysql_query($query);
while($row = mysql_fetch_assoc($run)){
$post_id = $row['post_id'];
$post_title = $row['post_title'];
$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>
<img src="images/<?php echo $post_image; ?>" width="300" height="300" />
<p align= "justify">
<?php echo $post_content ; ?>
</p>
<p align= "right">
<a href= "pages.php?id= <?php echo $post_id ; ?>" > Read more </a>
</p>
<?php } ?>
</div>
<!--This is footer area -->
<div> <?php include("includes/footer.php"); ?></div>
</body>
</html>