PHPMine
<? if(PHP > $Expectations) echo $Results ?>
by Angel S. Moreno
UNDER SOME SERIOUS CONSTRUCTION LINKS MAY NOT WORK
Asked 2010-02-06 07:34:02 by Tony H
I want to list the file like:
1 2 3
4 5 6
etc.
Here is my code:
$handle = opendir ('./gallery');
while (false !== ($file = readdir($handle))) {
if($file != "." && $file != ".." && $file != basename(__FILE__)) {
echo '<br /><a href="../gallery/'.$file.'"><img src="../gallery/'.$file.'" height=\"20%\" width=\"20%\"/></a><br />';
}
}
Anwered 2010-02-07 20:09:29 by ryan_pendleton2004
Try this:
$handle = opendir ('./gallery');$i=0;
while ($file = readdir($handle)){
if($file != "." && $file != ".." && $file != basename(__FILE__)){ $i++;
echo '<a href="../gallery/'.$file.'"><img src="../gallery/'.$file.'" height="20%" width="20%"/></a>'."\n";
if($i/3==floor($i/3)) echo "<br/>";
}
}
Questions and answers provided by the Yahoo Answers Community.