<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<?php
$dir = $_GET['dir'];
$filePath = "images/".$dir.'/'; //path to your images
$thumb_width = '150'; //image width for the thumbnails on the index page
$loop_end = '150'; //after how many thumnails a new line.
$target_thumb = '_blank'; //The target page for the biger picture, '_blank' or make it emty '' for same page hyperlink
$filePaththumb = $filePath.'thumbs/';
include 'include/functions.php';
$string =array();
$dir = opendir($filePaththumb);
while ($file = readdir($dir)) {
if (eregi("\.png",$file) || eregi("\.jpg",$file) || eregi("\.gif",$file) ) {
$string[] = $file;
}
}
$loop = "0";
while (sizeof($string) != 0){
$img = array_pop($string);
echo "<a href='$filePath$img' target='$target_thumb'><img src='$filePaththumb$img' hspace='5' vspace='5' border='0' width='$thumb_width.px'/></a>";
$loop = $loop + 1;
if ($loop == $loop_end) {
echo "<br>";
$loop = "0";
}
}
?>