I have a problem that perhaps one of you code geniouses out there could help me with...
I have want to develop a script that reads the contents of a directory for image(jpg) files and display all the images in a table, 1 image to 1 cell, then below each image I want to show the image name and a checkbox in a new cell check illustration below:

The directories all have a different number of images so the table cells need to be made for each image and image name.
I have been bashing my head at this but to no luck, here is my code below:
<?
while($entry = readdir($dir)) {
if($entry != "." || $entry != "..") {
$a = $a + 1;
if($a>"3")
{ echo "<tr>"; }
echo "<td>";
echo "<a href='$jcimages/$entry'><img src='$jcthumbs/$entry' border='2'></a>";
echo "</td> ";
if($a>"3")
{ echo "<tr>"; $a='1'; }
}}
?>
As you can see I am far off, but any help would be much appreciated..
thankya