Jimbo
Veteran Member
Posts: 1650 Reputation: 18
32 / /
Joined: Jul 2006
|
RE: Random Signature
quote: Originally posted by Eddie
but i dont want it to collect from a directory but links instead. thanks
quote: Originally posted by MeEtc
I have one, should work for you. Let be go find the code....
code: <?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/png");
$dir = "imgs" ;
srand((double)microtime()*1000000);
$i = 0;
$dirHandle = opendir($dir);
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."default.image");
?>
just be sure to put the images ina folder called 'imgs' and specify a default at the bottom
|
|