Sure, aight so you're this far right, you've read all the filenames into a big array, so you have somethign like this:
0 => file1.php
1 => picture.jpg
2 => video.mpg
3 => pngimage.png
Now, we only want to display them 2 per page. So first we're going to check to see if there was a variable passed through teh URL named 'StartPoint'
if ( $_GET['StartPoint'] ) {
$StartPoint = $_GET['StartPoint'];
} else {
$StartPoint = 0;
}
Now we array_slice the array:
// slice $array to make it start at $StartPoint and be only 2 items
$slice = array_slice ($array_with_filenames_in_it, $StartPoint, 2)
Now, loop through $slice:
foreach ($slice as $value) {
// print the ouptut / do stuff to fine filesizes
}
Then at the bottom fo your page have two links:
<a href="<?php print ($_SERVER['PHP_SELF'] . "?StartPoint=" . ($StartPoint - 2)); ?>">Previous Page</a>
<a href="<?php print ($_SERVER['PHP_SELF'] . "?StartPoint=" . ($StartPoint + 2)); ?>">Next Page</a>