Here's the index.php that a friend made for me for my images on ileet.net. Maybe this will help. <?php include('http://ileet.net/source/header.php'); // CONFIGURE THIS $dir_name = ""; $thumb_dir_name = "thumbs/"; // AND THAT ONLY =) $dir = opendir($thumb_dir_name); if (!$pg) { $pg = 1; } $e = $pg * 15; $pg--; $s = $pg * 15; $i = 0; $r = 0; echo "<table cellspacing=1 cellpadding=5 align=center>"; while ($file_name = readdir($dir)){ // if (ereg ("^[]+\.(jpg|gif|jpeg|png)$", $file_name)) { if (($file_name != "..") && ($file_name != ".") && ($file_name != "_vti_cnf")) { $fName = "$file_name"; if (($i >= $s) && ($i < $e)) { if ($r == 5) { $r = 0; echo "</tr>"; } if (!$r) { echo "<tr>"; } $file = "$dir_name$fName"; $size = @GetImageSize($file); $filesize = @filesize($file); $filesize = $filesize / 1024; $filesize = @round($filesize,0); $h = $size[1]; $w = $size[0]; if (($w) && ($h)) { $size = "$w x $h, $filesize<b></b>kb"; } elseif ((!$w) || (!$h)) { $size = "n/a, $filesize<b></b>kb"; } echo "<td> <a href=\"$file\"><img src=\"$thumb_dir_name$fName\" alt=\"\" border=0></a></td>"; $r++; } $i++; } } if ($r != 5) echo "</tr>"; echo "</table>"; echo "<div align=\"center\">"; $total = $i; // Number of images in directory $i = 1; // iiiiiiih! $img_per_page = 15; // Number of images per page. Change this any day =) $cur_img = 1; $total_pages = 1; while ($i <= $total) { if ($cur_img == $img_per_page) { if ($_GET["pg"] != $total_pages) { echo "<a href=\"$PHP_SELF?pg=$total_pages\">$total_pages</a> "; } else { echo "$total_pages "; } if ($i < $total) { $total_pages++; } $cur_img = 0; } elseif ($i == $total) { $isdone = $total_pages * $img_per_page; if ($isdone > $total) { // BEEP! More pix! if ($_GET["pg"] != $total_pages) { echo "<a href=\"$PHP_SELF?pg=$total_pages\">$total_pages</a> "; } else { echo "$total_pages "; } } } $cur_img++; $i++; } /** $pgs = $i / 15; $pgs = round($pgs,0); $c = $i % 15; if ($c != 0) $pgs++; $i = 1; $p = $pg + 1; echo "<div align=\"center\">"; while ($i < $pgs) { if ($p == $i) echo "$i "; else echo "<a href=\"$PHP_SELF?pg=$i\">$i</a> "; $i++; } **/ echo "</div>"; closedir($dir); include('http://ileet.net/source/footer.php'); ?>