-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
50 lines (36 loc) · 987 Bytes
/
index.php
File metadata and controls
50 lines (36 loc) · 987 Bytes
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
<?php
include_once("config.php");
$result = mysqli_query($mysqli, "SELECT * FROM users");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Homepage</title>
</head>
<body>
<h1><?php echo "Sample PHP Web Application"; ?></h1>
<a href="add.html">Add new Data</a><br/><br/>
<table>
<tr bgcolor='#cccccc'>
<td>Name </td>
<td>Age </td>
<td>Email </td>
<td>Created</td>
<td>Update</td>
</tr>
<?php
while( $res = mysqli_fetch_array($result)){
echo "<tr>";
echo "<td>".$res['name']."</td>";
echo "<td>".$res['age']."</td>";
echo "<td>".$res['email']."</td>";
echo "<td>".$res['date_created']."</td>";
echo "<td><a href=\"edit.php?id=$res[id]\">Edit</a> | <a href=\"delete.php?id=$res[id]\" onClick=\"return confirm('Are you sure you want to delete this record?')\">Delete</a></td>";
echo "</tr>";
}
?>
</table>
</body>
</html>