-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathindex.php
56 lines (31 loc) · 1.01 KB
/
index.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
<?php
$ch = require "init_curl.php";
curl_setopt($ch, CURLOPT_URL, "https://api.github.com/user/repos");
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
?>
<?php require "header.html" ?>
<h1>Repositories</h1>
<table>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<?php foreach ($data as $repository): ?>
<tr>
<td>
<a href="show.php?full_name=<?= $repository["full_name"] ?>">
<?= $repository["name"] ?>
</a>
</td>
<td><?= htmlspecialchars($repository["description"]) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<a href="new.php">New</a>
<?php require "footer.html" ?>