-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshow_contacts_msg.php
More file actions
61 lines (56 loc) · 2.03 KB
/
Copy pathshow_contacts_msg.php
File metadata and controls
61 lines (56 loc) · 2.03 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
58
59
60
61
<?php include 'includes/config.php';
?>
<div class="admin-form">
<?php
if (isset($_SESSION['email'])) {
?>
<h1>View all Contact Messgaes!</h1>
<div id="msg">
<?php
$query = "SELECT * FROM contact";
$result = $db->query($query);
if (!empty($result)) {
?>
<table>
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Subject</th>
<th>Message</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
while ($item = mysqli_fetch_assoc($result)) {
?>
<tr>
<td><?php echo $item['name'] ?></td>
<td><?php echo $item['email'] ?></td>
<td><?php echo $item['subject'] ?></td>
<td><?php echo $item['msg'] ?></td>
<td>
<form action="#" method="get">
<input type="hidden" name="id" value="<?php echo $item['id'] ?>">
<input type="submit" name="delete" value="Delete">
</form>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
?>
</div>
<?php
}
else
{
?><p>Not Logged In!</p><?php
}
?>
</div>