-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreader.php
executable file
·70 lines (64 loc) · 1.25 KB
/
reader.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
62
63
64
65
66
67
68
69
70
<?php
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors',1);
include('config.php');
session_start();
$renderPassform = false;
if(isset($_POST['password']) && $_POST['password'] == BK_PASS || isset($_SESSION['login']))
{
$_SESSION['login'] = true;
$sqlite_db = new PDO('sqlite:'.DB_PATH,DB_USER,DB_PASS);
$sql = "SELECT * FROM emails ORDER BY time DESC LIMIT 0, 50";
$sth = $sqlite_db->prepare($sql);
$sth->execute();
$rows = $sth->fetchAll();
}
else
{
$renderPassform = true;
}
?>
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>Milk Table</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
<?php
if($renderPassform):
?>
<form action="" method="post">
<input type="password" name="password" />
<input type="submit" value="login" />
</form>
<?php
else:
?>
<table style="text-align:center;">
<col width="400" />
<col width="250" />
<col width="250" />
<col width="250" />
<tr>
<th>Email</th>
<th>Store</th>
<th>IP</th>
<th>Submitted At</th>
</tr>
<?php
foreach($rows as $row) {
echo '<tr>';
echo '<td>'.$row['customer_email'].'</td>';
echo '<td>'.$row['store_name'].'</td>';
echo '<td>'.$row['ip'].'</td>';
echo '<td>'.$row['time'].'</td>';
echo '</tr>';
}
?>
</table>
<?php
endif;
?>
</body>
</html>