Jump to content

[SOLVED] whats wrong with this?


corillo181

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]
Link to comment
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.
Link to comment
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..
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.