-
Notifications
You must be signed in to change notification settings - Fork 0
/
indexOld.php
60 lines (58 loc) · 1.86 KB
/
indexOld.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
<?php
session_start();
// Use the Databse
include 'db.php';
?>
<!doctype html>
<html>
<head>
<title>Password Store Demo</title>
</head>
<body>
<div>
<h1>Add Password</h1>
<form action="addPassword.php" method="post">
<input type="text" name="password" />
<input type="submit" />
</form>
<table>
<tr>
<th>ID</th>
<th>Title</th>
<th>Encrypted Password</th>
<?php
$result = $db->query("SELECT * FROM passwords");
foreach($results as $pass){
echo "<tr>";
echo "<td>" . $pass['id'] . "</td>";
echo "<td>" . $pass['title'] . "</td>";
echo "<td>" . base64_encode($pass['encryptedPass']) . "</td>";
echo "</tr>";
}
?>
</tr>
</table>
</div>
<div>
<form action="addUser.php" method="post">
Add User
<input type="text" name="username" />
<input type="submit" />
</form>
<table>
<tr><th>ID</th><th>Username</th><th>Public Key</th><th>Private Key</th></tr>
<?php
$users = $db->query("SELECT * FROM users");
foreach($users as $user){
echo "<tr>";
echo "<td>" . $user['id'] . "</td>";
echo "<td>" . $user['username'] . "</td>";
echo "<td>" . $user['publicKey'] . "</td>";
echo "<td>" . $user['privateKey'] . "</td>";
echo "</tr>";
}
?>
</table>
</div>
</body>
</html>