summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McFarlane <simon@piston.pw>2015-05-27 04:59:05 +0200
committerSimon McFarlane <simon@piston.pw>2015-05-27 04:59:05 +0200
commit8cc3bd12e3082166d7522f9a487125baf5d7fefa (patch)
treecbfd671e800b2d79bc5578b147728e79da8931bb
parent43de459103ad968d75e2b68db18c39a9751a9820 (diff)
Add background scripts
-rwxr-xr-xbg.php20
-rwxr-xr-xc.php20
2 files changed, 40 insertions, 0 deletions
diff --git a/bg.php b/bg.php
new file mode 100755
index 00000000..bb0b9d88
--- /dev/null
+++ b/bg.php
@@ -0,0 +1,20 @@
+<?php
+//renaming to bg.php
+$dir = "walls/";
+$files = scandir($dir);
+$images = array_diff($files, array('.', '..'));
+$name = $images[array_rand($images)];
+// open the file in a binary mode
+$fp = fopen($dir . $name, 'rb');
+
+// send the right headers
+header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1
+header('Pragma: no-cache'); // HTTP 1.0
+header('Expires: 0'); // Proxies
+header('Content-Type: ' . $fp['type']);
+header('Content-Length: ' . $fp['bytes']);
+
+// dump the picture and stop the script
+fpassthru($fp);
+exit;
+?>
diff --git a/c.php b/c.php
new file mode 100755
index 00000000..00c23180
--- /dev/null
+++ b/c.php
@@ -0,0 +1,20 @@
+<?php
+$dir = "banners/";
+$files = scandir($dir);
+$images = array_diff($files, array('.', '..'));
+$name = $images[array_rand($images)];
+$fp = fopen($dir . $name, 'rb');
+
+// send the right headers
+header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1
+header('Pragma: no-cache'); // HTTP 1.0
+header('Expires: 0'); // Proxies
+header('Content-Type: ' . $fp['type']);
+header('Content-Length: ' . $fp['bytes']);
+
+// dump the picture and stop the script
+//fpassthru($fp);
+print($fp['type']);
+print('dicks');
+exit;
+?>