forked from Deekshavedula/FLINTECH
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathonly.php
More file actions
71 lines (61 loc) · 1.44 KB
/
only.php
File metadata and controls
71 lines (61 loc) · 1.44 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
62
63
64
65
66
67
68
69
70
71
<!DOCTYPE html>
<html>
<head>
<style>
body {
background:#F0FFF0;
font-family: "Nunito", sans-serif;
padding: 20%;
}
table {
border-collapse: collapse;
width: 100%;
}
table, th, td {
border: 1px solid black;
padding: 15px;
text-align: left;
border-bottom: 1px solid #ddd;
}
th {
height: 50px;
}
td {
height: 50px;
vertical-align: bottom;
}
tr:hover {background-color: #f5f5f5;}
tr:nth-child(even) {background-color: #f2f2f2;}
th {
background-color: #32546e;
color: white;
}
<div style="overflow-x:auto;">
</style>
</head>
<body>
<?php
$servername = "localhost";
$username = "id14469414_root";
$password = "Rockstar@123";
$dbname = "id14469414_contact_form";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT name, email, phone, message FROM contact_form";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo "<table><tr><th>Name</th><th>Email</th><th>Phone</th><th>Message</th></tr>";
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<tr><td>" . $row["name"]. "</td><td>" . $row["email"]. "</td><td> " . $row["phone"]. "</td><td>". $row["message"]. "</td></tr>";
}
echo "</table>";
} else {
echo "0 results";
}
$conn->close();
?>