First, here's the code...
<?php
$dir_name="archive";
$dir = opendir($dir_name);
$basename = basename($dir_name);
$fileArr = array();
while ($file_name = readdir($dir))
{
if (($file_name !=".") && ($file_name !=".."))
{
$fName = "$dir_name/$file_name";
$fTime = filemtime($fName);
$fileArr[$file_name] = $fTime;
}
}
arsort($fileArr);
$numberOfFiles = sizeOf($fileArr);
for($t=0;$t<$numberOfFiles;$t++)
{
$thisFile = each($fileArr);
$thisName = $thisFile[0];
$thisTime = $thisFile[1];
$thisTime = date("d M y", $thisTime);
$thisPath = "archive/".$thisName;
$buffer= file($thisPath);
$head = $buffer[2];
$body = $buffer[7];
$date = $buffer[4];
echo"<tr bgcolor=#cccccc><td><font size=2>$date</td><td><font size=2><a id=nu href=$thisPath><b>$head</b></a></td></tr>";
}
closedir ($dir);
?>
Basically it displays a list of files in the "Archive" directory, in date order.
However there are a lot of files in that directory, and I'd like users to be able to see the first 25, then have the option of moving to the next page to see the next 25 files, and so on, each page having the option of going back to 25 more recent, and 25 older files.
Presumably it would be the same method used to split search engine results across pages.
Can anyone help?