Hi all, I have a working gallery script which reads a directory then shows all thumbnails, each linking to the full size image. I'm trying to change it so that the page shows an image (fullsize) then links to the previous/next images in the sequence & then all the thumbnails below (the bit that's working fine at the moment). The filenames are straight from the camera (eg DSC102834.jpg or something) so I know that I need to get all the filenames into an array then use the key indexing or something, but I'm not sure how to do it? Also I'm not sure if I should be using readdir or glob? I've modified the code below so that it just displays the text of the filename rather than the actual image to speed up testing/reduce bandwidth. If anyone could point me in the right direction I'd really appreciate it Here is my code: <? $folder = "images/"; echo "<table>\r\n<tr>\r\n"; $count = 0; if(is_dir($folder)) { if($handle = opendir($folder)) { while(($file = readdir($handle)) !== false) { //Filter out any unwanted files if ($file !="thumbs.db" && $file !="_notes" && !is_dir($file)) { echo "<td><a href=\"" . $file . "\">" . $file . "</a></td>\r\n"; $count++; if (($count % 4) == 0) { echo "</tr>\r\n"; echo "<tr>\r\n"; } } } closedir($handle); } } echo "</tr>\r\n</table>\r\n"; echo "<br>\r\n"; echo "There are " . $count . " photos"; ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php