This script here is to loop out all the jpg-files in a selected folder ($dir) and display thumbnail images with a help from include.php.
Now I want it to show only 5 results at each time and and show the next files on the "next page" and so on...
I know that it's easy to do this if the files have numbers instead of letters or simbols but i have done it allready but i don't like it.
Any help would help. 🙂
Stebbi Vignir - stebbivignir@simnet.is
<?php
//Input variables:
//$dir - The folder
$mappa = opendir($dir);
// The lopp is created
while (false !== ($file = readdir($mappa)) ) {
if (eregi("jpg$", $file)) {
// The loop printed
print ("<table width=450 border=0 cellspacing=1 bgcolor=#FFFFFF>");
print ("<tr bgcolor=#666666>");
print ("<td width=1><a href=$dir/$file><img src=include.php?sz=100&imageurl=$dir/$file border=0></a></td>");
print ("<td>");
print ("<!-- Here could be some file info -->");
print ("</td>");
print ("</tr>");
print ("</table><br>");
}
}
closedir($mappa);
?>