I am looking to know if there is away to take my random image script to multiple images with using a database..
I currently have a directory of 20 or so images and would like to randomly display four of them on my page without any of them being duplicates > they all have to be unique.
This is what I am currently using for one image
$imgDirectory = opendir("images/random_insert");
$imgArray = array();
while ($file = readdir($imgDirectory))
{
if($file != "." && $file != "..")
{
array_push($imgArray,$file);
}
}
closedir($imgDirectory);
mt_srand((double)microtime() * 1000000);
$randval = mt_rand(0,sizeof($imgArray)-1);
$getEd = "<img src=\"/images/random_insert/".$imgArray[$randval]."\" width=\"150\" height=\"440\" border=\"0\" alt=\"\">";