-
Notifications
You must be signed in to change notification settings - Fork 0
/
viewall.php~
56 lines (49 loc) · 1.49 KB
/
viewall.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
<!DOCTYPE html>
<html lang="en">
<!-- This site was created by / belongs to Cheng Cheng.!-->
<head>
<title>Westview Tutoring</title>
<link href="bootstrap.css" rel="stylesheet">
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="index.php">Westview Tutoring</a>
<div class="nav-collapse">
<ul class="nav">
<li><a href="index.php">Home</a></li>
<li><a href="chat.php">Chat</a></li>
<li><a href="tutor.php">Tutors</a></li>
</ul>
<ul class = "nav pull-right">
<li><a href="contact.php">Contact</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<br><br><br>
<div class = "container">
<?php
include("gmongo.php");
$collection = $db->posts;
$cursor = $collection->find();
$cursor->sort(array('_id' => -1));
$true = false;
foreach($cursor as $doc)
{
if($true)
{
echo "<hr style='border: none; height: 1px; color: 080808; background: grey;'/>";
}
echo "<h5>".$doc['post']."</h5>";
echo "<a href = 'view.php?id=".$doc['_id']."'>View this thread</a><br>";
$true = true;
echo "<br><br>";
$collection -> remove($doc);
}
?>
</div>
</body>
</html>