valign="bottom">
online/wildlifesafari/images/themeHeaders/"; //Builds an array with the file names from the themeHeaders Directory $files=array(); if ($handle=opendir("$path")) { while(false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { if(substr($file,-3)=='gif' || substr($file,-3)=='jpg' || substr($file,-3)=='png' || substr($file,-3)=='bmp') $files[count($files)] = $file; } } } closedir($handle); //Chooses random animal skin. //Calculation subtracts 1 from the number of skins in the directory to account for PHP starting at 0 //Then it assign a variable $fileName with the name of the graphic file (including extension) //$random=rand(0,count($files)-1); //$fileName = $files[$random]; srand ((double) microtime() * 1000000); $random = rand(0,count($files)-1); $fileName = $files[$random]; //Assign paths and file names to variables for image calls $header="../images/themeHeaders/$fileName"; $sidebar="../images/themeSidebars/$fileName"; $thumbnail="../images/themeThumbnails/$fileName"; $description="../images/themeDescriptions/$fileName"; ?>
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||