-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontacts.php
More file actions
51 lines (34 loc) · 1.33 KB
/
contacts.php
File metadata and controls
51 lines (34 loc) · 1.33 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
<head>
<link rel="stylesheet" href="projectstyle.css" type="text/css">
</head>
<?php
session_start();
include('connection.php');
include('header.php');
include('navigation.php');
if(isset($_POST['delete'])){
$Delete = "DELETE FROM contacts WHERE sno='$_POST[hidden]'";
mysqli_query($conn, $Delete);
}
$sql = "select * from contacts";
$result = mysqli_query($conn, $sql) or die("Bad Query: $sql");
echo"<table border='1'>";
echo"<tr><td style = 'text-align:center;'>S.No</td><td style = 'text-align:center;'>Name</td><td style = 'text-align:center;'>Email</td><td style = 'text-align:center;'>Phone-Number</td><td style = 'text-align:center;'>Message</td><td colspan='2' style = 'text-align:center;'>Edit</td></tr>";
while($row = mysqli_fetch_array($result)){
echo "<form action=contacts.php method=post>";
echo "<tr>";
echo "<td>" . $row['sno'] . " </td>";
echo "<td>" . $row['name'] . " </td>";
echo "<td>" . $row['email'] . " </td>";
echo "<td>" . $row['phoneno'] . " </td>";
echo "<td>" . $row['message'] . " </td>";
echo "<td>" . "<input type=hidden style=width:0;padding:0;margin:0; name=hidden value=" . $row['sno'] . " </td>";
echo "<td>" . "<input type=submit class = button name=delete value=Delete" . " </td>";
echo "</tr>";
echo "</form>";
}
echo "</table>";echo "</table>";
?>
<?php
include('footer.php');
?>