-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelete.php
64 lines (53 loc) · 1.56 KB
/
delete.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
<?php require 'engine/connection.php'; ?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset='utf-8'>
<?= head('Home'); ?>
</head>
<body>
<div class="pure-g" id="layout">
<?php include 'includes/header.inc.php'; ?>
<div class="content pure-u-1 pure-u-med-3-4">
<form action="search.php" class="pure-form" method="get">
<input type="search" name="title" placeholder="Search for posts" autocomplete="off">
</form>
<div>
<?php
if (isset($_GET['title'])) {
$search = '%'. $_GET['title'] .'%';
$posts = query("SELECT id, title, name, email, category,created_at, LEFT(body, 330) as body FROM posts WHERE title LIKE :search ORDER BY id DESC",
array(':search' => $search),
$conn);
if($posts){
include 'includes/content.php';
}else{
echo "<h2>No Match Found.</h2>";
}
}
?>
</div>
<?php include 'includes/footer.inc.php'; ?>
<a href="#" class="scrollup">Scroll</a>
</div><!-- End Content -->
</div><!-- End pure-u-1-->
</div><!-- End pure-g-r -->
<!-- Script for scroll -->
<script>
$(document).ready(function(){
$(window).scroll(function(){
if ($(this).scrollTop() > 100) {
$('.scrollup').fadeIn();
} else {
$('.scrollup').fadeOut();
}
});
$('.scrollup').click(function(){
$("html, body").animate({ scrollTop: 0 }, 600);
return false;
});
// prettyPrint();
});
</script>
</body>
</html>