-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstats.php
59 lines (39 loc) · 1.33 KB
/
stats.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<link href='http://fonts.googleapis.com/css?family=Asap:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link rel="shortcut icon" href="favicon.ico" />
<?php
include 'config.php';
echo "<title>$title</title>";
?>
</head>
<body>
<?php
include 'config.php';
echo "<div id='content'><h1>$title</h1>";
$db = new PDO('sqlite:pygmyfoto.sqlite');
echo "<div class='center'>$navigation</div>";
echo "<table border=0>";
$result = $db->prepare("SELECT id, title, count FROM photos ORDER BY count DESC");
$result->execute();
foreach($result as $row)
{
echo "<tr><td><p>".$row['title']."</p></td><td><p>".$row['count']."</p></td></tr>";
}
echo "</table>";
$result->closeCursor();
$db = NULL;
echo "<div class='footer'>$footer</div>";
$ip=$_SERVER['REMOTE_ADDR'];
$date = $date = date('Y-m-d H:i:s');
$page = basename($_SERVER['PHP_SELF']);
$file = fopen("ip.log", "a+");
fputs($file, " $ip $page $date \n");
fclose($file);
?>
</div>
</body>
</html>