The code below works fine, except for one small thing - it displays all of the images in one row. What I want is to display four images on each row, each in its own column. I have been able to do this with an array from a database search, but I have been unable to figure out how to do this using the list function.
Here is the code that I am currently trying to get working:
if ($handle = opendir($thumb_folder)) {
echo "<tr>\n";
while (false !== ($file = readdir($handle))) {
list($img_width, $img_height, $type, $attr) = getimagesize($thumb_folder.$file);
echo "<td width=\"".($cell * 0.25)."\" align=\"left\" valign=\"middle\">";
echo "<a class=\"none\" href=\"$target_page.php?section=$section&pid=$pid&tabs=$tabs&picSelected=$file\">";
echo "<img border=\"0\" height=\"$img_height\" width=\"$img_width\" align=\"absmiddle\" src=\"$thumb_folder/$file\">";
echo "</a>";
echo "</td>";
}
echo "</tr>\n";
closedir($handle);
}