diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2009-02-24 16:39:19 -0500 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2009-02-24 16:39:19 -0500 |
commit | 9f112c2e1668c286bdbf832f6e2f4451b7d52b44 (patch) | |
tree | 9a08348d0f79167da756d215ac759141f94d3d38 /comic.php | |
parent | eee98526c48b9154cd9e9bc8bc3e07769e6a39ea (diff) | |
download | pillowcase-9f112c2e1668c286bdbf832f6e2f4451b7d52b44.tar.gz pillowcase-9f112c2e1668c286bdbf832f6e2f4451b7d52b44.tar.bz2 pillowcase-9f112c2e1668c286bdbf832f6e2f4451b7d52b44.zip |
Protected pending comics
Diffstat (limited to 'comic.php')
-rw-r--r-- | comic.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/comic.php b/comic.php new file mode 100644 index 0000000..352060b --- /dev/null +++ b/comic.php | |||
@@ -0,0 +1,31 @@ | |||
1 | <?php | ||
2 | |||
3 | include('includes/db.php'); | ||
4 | |||
5 | if (!isset($_GET['id'])) | ||
6 | { | ||
7 | header('Location: /'); | ||
8 | exit; | ||
9 | } | ||
10 | |||
11 | $getcomic = "SELECT * FROM comics WHERE filename = \"" . $_GET['id'] . ".png\""; | ||
12 | $getcomic2 = mysql_query($getcomic); | ||
13 | $getcomic3 = mysql_fetch_array($getcomic2); | ||
14 | |||
15 | if ($getcomic3['filename'] != ($_GET['id'] . '.png')) | ||
16 | { | ||
17 | header('Location: /'); | ||
18 | exit; | ||
19 | } | ||
20 | |||
21 | if ($getcomic3['status'] != 'publish') | ||
22 | { | ||
23 | header('Location: /'); | ||
24 | exit; | ||
25 | } | ||
26 | |||
27 | header('Content-type: image/png'); | ||
28 | |||
29 | readfile($_SERVER['DOCUMENT_ROOT'] . '/images/comics/' . $_GET['id'] . '.png'); | ||
30 | |||
31 | ?> | ||