On Apr 13, 7:48 pm, "prophet" <M_Mo...@hotmail.comwrote:
......or do it server-side with a scripting language, perhaps php
function randPicName()
{
$cnt=-1;
$dir = opendir("/var/www/my-site/my-images/my-rands");
while ( $file = readdir($dir))
{
if($file[0] != ".") /// or call some fancier isImage function
{
$cnt++;
$pics[$cnt] = trim($file);
}
}
srand((double)microtime()*1000000);
$randval = rand(2,$cnt);
$pic = $pics[$randval];
/// this is an image name only, so you'd
/// have to prepend a path to make an img src url with it.
return ($pic);
}