-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpull.php
More file actions
52 lines (47 loc) · 1.17 KB
/
Copy pathpull.php
File metadata and controls
52 lines (47 loc) · 1.17 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
<?php
include ("head.php");
include ("nav.php");
if (empty($_SESSION['login'])) {
header('location:login.php');
}
?>
<script>
function del(sno){
if (confirm("Do you really dant to delete!")){
window.location.href="pull.php?delete="+sno
}
}
</script>
<?php include ("db.php");
$query= $db->query("SELECT * FROM cform");
echo '<div class="tablebox">';
echo'<table class="table">';
echo'<tr><th>S.no</th>
<th>Full Name</th>
<th>Email ID</th>
<th>Message By user</th>
<th>Operations</th>
</tr>
';
$a=1;
while($data= $query->fetch()){
echo "<tr>";
echo "<td>".$a."</td>";
echo "<td>".$data['fullname']."</td>";
echo "<td>".$data['email']."</td>";
echo "<td>".$data['message']."</td>";
echo "<td><button onclick=del(".$data['sno'].")>Delete</button></td>";
echo "</tr>";
$a=$a+1;
}
echo'</table></div>';
if (isset($_GET['delete'])){
include('db.php');
$query= $db->prepare('delete from cform where sno=:sno');
$query->execute(array(
":sno"=>$_GET['delete']
));
header('location:pull.php');
}
include "footer.php";
?>