All pastes #393138 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-03-13 10:23 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 = "/pathtoimageshere/albums/"; 

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

$i = 0;

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

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

{

if($im != ".." && $im != ".")

{

$image[$i] = $im;

$i++;

}

}

closedir($dirHandle);

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

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

readfile($dir."error/error.gif");

?>