View Single Post
ישן 22-10-08, 23:55   # 3
CodeX
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: Oct 2006
הודעות: 172

CodeX לא מחובר  

תודה,
יש לך אולי מושג איך אני הופך את הקוד הזה:
PHP קוד:
<?php
if ($handle opendir('img/avatars')) {
    while (
false !== ($file readdir($handle))) {
        if (
$file != "." && $file != "..") {
            echo 
"<img src='img/avatars/$file'><br>";
        }
    }
    
closedir($handle);
}
?>
שיציג כל תמונה ותמונה בכל תא בנפרד ב3 על 3?
יענו אין לי בעיה עם הלולאה והטבלה,
יש לי בעיה עם ה3 על 3 =\

אשמח אם תעזור..

עריכה:
ניסיתי לעשות את זה:
PHP קוד:
<table>
<?php 
if ($handle opendir('img/avatars')) 
    { 
        while (
false !== ($file readdir($handle))) 
    {
    for (
$j=1$j<=3$j++) 
    { echo 
"<tr>";  }
    for (
$j=1$j<=3$j++) {
        if (
$file != "." && $file != "..") { 
            echo 
"<td><img src='img/avatars/$file'></td>";  }
     } 
    echo 
"</tr>";
    } 
    
closedir($handle); 

?> 
</table>
אבל זה הציג לי כל תמונה 3 פעמים...

Last edited by CodeX; 23-10-08 at 00:07..
  Reply With Quote