The script is
<?php
if(!$_GET['start']) {
$start = 0;
} else {
$start = $_GET['start'];
}
$exclude_files = array("");
$ifiles = Array();
$handle = opendir('.');
$number_to_display = '9';
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && !in_array($file, $exclude_files)) {
sort ($ifiles);
$ifiles[] = $file;
}
}
closedir($handle);
$total_files = count($ifiles);
$req_pages = ceil($total_files/$number_to_display);
echo "total files = ". $total_files."<br>";
for($z=0; $z<$number_to_display; $z++) {
//$vf = $z+($start+$number_to_display);
$vf = $z+$start;
if ($ifiles[$vf] != "")
echo "<a href=\"". $ifiles[$vf]. "\">". $ifiles[$vf] . "</a>\n";
echo '<br>';
}
echo "<br>Req Pages = ". $req_pages. "<br>";
echo "<a href=\"?start=0\">First</a> |";
for($x=0; $x<$req_pages; $x++) { ?>
<a href="?start=<? echo $x*$number_to_display; ?>"><? echo $x+1; ?></a> |
<? } ?>
<a href="?start=<? echo ($x-1)*$number_to_display; ?>">Last</a> |
just put it in the folder you want to read
you can change or add separated by commas
$exclude_files = array("whatever file or folder");
whatever number you want on each page
$number_to_display = '9';