<?
$dir = \'/path/goes/here/\';
$htmldir = \'http://www.dtfusion.com/randomsplash/splashes/\';
$opendir = opendir($dir);
while ($file = readdir($opendir))
$array[] = $file;
closedir($opendir);
shuffle($array);
for ($x = 0; $x < 1; $x++ )
{
include($htmldir.$array[$x]);
}
?>
As you can probably tell, I am attempting to make a random splash script that searches the specified directory for html files and randomly displays one of them. This script is fully functional, although occasionally it will bring up the apache directory listing for subfolders of the $dir directory. I was wondering if anybody knew of any ways to prevent it from doing so. Thanks!
Chuck