PHP beginner | 
                         | 
                        @timo: dat is heel veel werk. 
dit is misschien veel makkelijker: 
    
    
        
            
                <?php
$map = "dir/waar/fotos/zich/bevinden/";
$foto = array();
chmod($map, 0777);
$handle = opendir($map);
while(false !== ($read = readdir($handle))){
if($read != "." && $read != ".." && is_file($read){
//ext checken
$aToegestaan = array("jpg", "JPG", "gif", "GIF"); //hier alle extensies in zetten die toegestaan zijn, maar wel ZONDER '.'
$aExt = explode(".", $read);
$i = count($aExt) - 1;
if(in_array($aExt[$i], $aToegestaan){
$foto[] = $map."/".$read;
}
}
}
closedir($handle);
$iFotos = count($foto); //aantal foto's in map
$iRandom = rand(0, $iFotos);
?>
<img src="<?=$foto[$iRandom]; ?>" alt="Random pic" border="0" />
             
            <?php   $map = "dir/waar/fotos/zich/bevinden/";   while(false !== ($read = readdir($handle))){ if($read != "." && $read != ".." && is_file($read){   //ext checken $aToegestaan = array("jpg", "JPG", "gif", "GIF"); //hier alle extensies in zetten die toegestaan zijn, maar wel ZONDER '.'     $foto[] = $map."/".$read; } } }     $iFotos = count($foto); //aantal foto's in map   $iRandom = rand(0, $iFotos);   ?>   <img src="<?=$foto[$iRandom]; ?>" alt="Random pic" border="0" /> 
 
  
         
          
     
  
 
let op: ik heb het niet getest, gewoon rechtstreek hier getypt 
 
 
Robin 
 |