Location: PHPKode > scripts > wwdgallery > wwdgallery/images/rid.php
#This script has been developped by Nenad Motika [hide@address.com]
#Please feel free to use it and to contact me for any reason

//read folder
while ($file = readdir($folder)) 
$names[count($names)] = $file; 
//sort file names in array
//remove any non-images from array
for ($i=0;$names[$i];$i++){
if ($ext==".jpg"||$ext==".gif"||$ext=="jpeg"||$ext==".png"){$names1[$tempvar]=$names[$i];$tempvar++;}
srand ((double) microtime() * 10000000);
$rand_keys = array_rand ($names1, 2);
//random image from array
//image dimensions
$dimensions = GetImageSize($slika); 
if (isset($pic)){header ("Location: $slika");}
else {echo "<img src=\"$slika\" $dimensions[3]>";}
Return current item: wwdgallery