Onderstaande gebruik ik maar af en toe laat hij een foto niet zien.
Alle foto's zijn goed maar ik heb het idee dat hij de map 'foto' probeert te tonen
Alle foto's zijn goed maar ik heb het idee dat hij de map 'foto' probeert te tonen
PHP:
<?
$dir = "foto/";
$teller=-1;
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$teller++;
$img[$teller] = $file;
}
}
closedir($handle);
}
$random = rand(0, count($img));
echo "<a href=$dir$img[$random] TARGET=_blank><img src=\"$dir$img[$random]\" width=333 height=222 border=0></a>";
?>