Jump to content

Archived

This topic is now archived and is closed to further replies.

corillo181

[SOLVED] whats wrong with this?

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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 on


do the row and column loop outside and have some continue in there to move on to the next file.

Share this post


Link to post
Share on other sites
[!--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 on
do 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..

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.