-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlist.php
61 lines (41 loc) · 928 Bytes
/
list.php
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
<!DOCTYPE html>
<html>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
padding: 10px;
}
</style>
<body>
<table style="width:100%">
<caption>Link Management</caption>
<?php
$string = file_get_contents("data.json");
$data = json_decode($string,true);
// print_r($data);
echo "<tr>";
echo "<th> Video ID </th>" ;
echo "<th> Link </th>";
echo "<th> Action </th>";
echo "/<tr>";
foreach ($data as $key => $value) {
echo "<tr>";
$folder = "http://$_SERVER[HTTP_HOST]/index.php?id=";
echo '<td> <a href='.$folder.$key.'>'.$key.'</a></td>' ;
echo "<td> <a href=".$value.">".$value."</a></td>";
echo "<td>
<form action='delete.php?id=".$key."' method=\"post\">
<input type=\"submit\" name=\"submit\" value=\"Delete\">
</form>
</td>";
echo "/<tr>";
}
?>
</table>
<br>
<a href="creat.html">Add Link<a>
</body>
</html>