Ok... here is where I'm a bit confused... and that is printing out the php array to the javascript array.
I know to get the list of files into an array from a directory with PHP, I would do this:
<?php
$handle = opendir('images/rand_front/');
while ($file = readdir($handle)) {
if ($file == "." || $file == "..") {
} else {
$files[] = $file;
}
}
closedir($handle);
?>
Then the slideshow is this:
<SCRIPT LANGUAGE="JavaScript">
<!--
//set image paths
src = ["images/rand_front/ph_bandung_11.jpg", "images/rand_front/ph_bandung_front.jpg"]
//set duration for each image
duration = 4;
ads=[]; ct=0;
function switchAd() {
var n=(ct+1)%src.length;
if (ads[n] && (ads[n].complete || ads[n].complete==null)) {
document["Ad_Image"].src = ads[ct=n].src;
}
ads[n=(ct+1)%src.length] = new Image;
ads[n].src = src[n];
setTimeout("switchAd()",duration*1000);
}
onload = function(){
if (document.images)
switchAd();
}
//-->
</SCRIPT>
<IMG NAME="Ad_Image" SRC="images/rand_front/ph_bandung_11.jpg" BORDER=0>