-
Notifications
You must be signed in to change notification settings - Fork 1
/
list.php
42 lines (31 loc) · 958 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
<?php
if($_GET['action'] == "New Entry")
{
header("Location: http://aarontag.com/addressbook/edit.php?eid=-1&uid=".$_GET['uid']);
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Welcome, User!</title>
</head>
<body>
<?php
$uid = $_GET['uid'];
$db = new SQLite3("database.db") or die('Could not open file');
//$result = $db->query('SELECT name, id, uid FROM entry');
$result = $db->query('SELECT name, id, uid FROM entry WHERE uid == '.$uid);
while($row = $result->fetchArray())
{
$eid = $row['id'];
$name = $row['name'];
$uid = $row['uid'];
echo "<a href=edit.php?eid=".$eid."&uid=".$uid.">".$name."</a><br/>";
}
?>
<form action = "list.php" method = "GET">
<input type = "submit" name = "action" value = "New Entry" />
<input type="hidden" name="uid" value="<?echo($_GET['uid'])?>" />
</body>
</html>