PDA

View Full Version : Help Me!



TecFreak
August 8th, 2003, 10:48 PM
<?php
$dh = opendir(".");
while (false !== ($file = readdir($dh)))
{
if (preg_match('/.jpg$/i', $file) and $file != "signature.jpg")
{
$filelist[] = $file;
}
}

srand((double)microtime()*1000000);
$picnum = rand(0, sizeof($filelist) - 1);

header("Location: " . $filelist[$picnum]);

closedir($dh);
?>
tell me what's wrong with this image rotator that doesn't want to work!

Jubba
August 8th, 2003, 11:24 PM
what is it doing exactly? because if you want it to just go to a random image everytime the PHP script is accessed, then it works fine..

I copied and pasted the script onto my server and it works fine. PHP version 4.3.2