think-digitally Posted June 19, 2008 Author Share Posted June 19, 2008 hmm, I still get it to work, it shows internal server error, and sometimes loads a page, but with random ?and blocks all over it. Any ideas? Heres what I put in <?php $top=6; //How many images you have... or anything I guess. $dir="2/"; $od=opendir($dir); $rand=rand(1,$top); $ndone=true; while ($ndone) { while ($file=readdir($od)) { $nr=rand(1,$top); if ($nr==$rand) { readfile($dir."".$file); $ndone=false; } } } closedir($od); ?> Link to comment https://forums.phpfreaks.com/topic/110786-solved-image-retreival/page/2/#findComment-568967 Share on other sites More sharing options...
Stephen Posted June 19, 2008 Share Posted June 19, 2008 You have to fix the dir. Mine was set to like "/home2/site/www/images/" Link to comment https://forums.phpfreaks.com/topic/110786-solved-image-retreival/page/2/#findComment-569343 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.