The code (don't laugh)
Code: Select all
<?php
$pic_dir = opendir('img_1');
while (false !== ($fotos[] = readdir($pic_dir))) {
if ($fotos != "." && $fotos != "..")
while (count($fotos)) {
$val=array_shift($fotos);
print "<table cellpadding='2' cellspacing='2'>";
print "<tr><td><a href=".$val."><IMG src=".$val." width="170" height="127"></a></td>";
$val=array_shift($fotos);
print "<td><a href=".$val."><IMG src=".$val." width="170" height="127"></a></td>";
$val=array_shift($fotos);
print "<td><a href=".$val."><IMG src=".$val." width="170" height="127"></a></td></tr>";
print "</table>";
}
}