corillo181 Posted April 26, 2006 Share Posted April 26, 2006 it was working fine displaying my pictures, but out of no where it stared only displaying the first picture in the directory if any one one please help me.. as quick as you can..[code]<table border="1"><?$path = "/Gallery/thumbs/";$handle = opendir($path);$row = 3;$col = 3;while(false !==($file = readdir($handle))){if($file !="." && $file !=".."){ for($r=1;$r <= $row; $r++){ echo "<tr>"; for($c=1; $c <= $col; $c++){ echo "<td><img src=$path/$file></td>"; } echo "</tr>";}closedir($handle);}}?></table>[/code] Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted April 26, 2006 Share Posted April 26, 2006 how many files are in the directory?You loop through rows and columsn INSIDE the file loop - so you will probably get 9 of the first file and then 9 of the second and so ondo the row and column loop outside and have some continue in there to move on to the next file. Quote Link to comment Share on other sites More sharing options...
corillo181 Posted April 26, 2006 Author Share Posted April 26, 2006 [!--quoteo(post=368929:date=Apr 26 2006, 02:11 PM:name=ToonMariner)--][div class=\'quotetop\']QUOTE(ToonMariner @ Apr 26 2006, 02:11 PM) [snapback]368929[/snapback][/div][div class=\'quotemain\'][!--quotec--]how many files are in the directory?You loop through rows and columsn INSIDE the file loop - so you will probably get 9 of the first file and then 9 of the second and so ondo the row and column loop outside and have some continue in there to move on to the next file.[/quote] i got a lot of pictures in there..oh i see i seen that contenie but i dont remeber how to use it, it bypassed my becuase i'm staring little by little.. so every little thing turns in to a big problem for me.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.