-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisplay.php
More file actions
37 lines (28 loc) · 840 Bytes
/
display.php
File metadata and controls
37 lines (28 loc) · 840 Bytes
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
<?php
// ModernCount Copyright Studio 384 2013-2014
if (!file_exists("config.php")) {
header("Location: installer");
exit;
}
require_once("config.php");
//Connect to database
@$con = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if (!$con) {
die("Error: Could not connect to database (" . mysql_error() . "). Check your database settings are correct.");
}
mysql_select_db(DB_NAME, $con);
if (isset($_GET["id"])) {
$id = mysql_real_escape_string($_GET["id"]);
} else {
die("Error: ID cannot be blank.");
}
//If ID exists, show count or else die
$showinfo = mysql_query("SELECT `count` FROM `Data` WHERE `id` = \"$id\"");
$showinforesult = mysql_fetch_assoc($showinfo);
if (mysql_num_rows($showinfo) != 0) {
echo $showinforesult["count"];
} else {
die("Error: ID does not exist.");
}
mysql_close($con);
?>