All pastes #393137 Raw Edit

Stuff

public text v1 · immutable
·published 2007-03-13 10:22 UTC
rendered paste body
<?php

Header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");

Header("Expires: Thu, 19 Nov 1981 08:52:00 GMT");

Header("Pragma: no-cache");

Header("Content-Type: image/gif");



$dir = "/var/www/vhosts/photos.tr0lled.com/httpdocs/gallery/g2data/albums/"; // This is the folder where the images are



srand((double)microtime()*1000000);

$i = 0;

$dirHandle = opendir($dir); // Open the images folder

while(($im = readdir($dirHandle)))

{

if($im != ".." && $im != ".") // Don't read in the 2 folders ".." and "."

{

$image[$i] = $im; // Select an image

$i++;

}

}

closedir($dirHandle); // Close the folder

$n = rand(0,(count($image)-1));



if(!readfile($dir."/".$image[$n])) // Read the image

readfile($dir."error/error.gif"); // If the script can't find the directory, display this image

?>