11-21-2011, 10:58 AM
|
#30 (permalink)
|
|
The Acquainted
Join Date: Nov 2007
Location: Sweden
Posts: 106
Thanks: 13
|
Quote:
Originally Posted by Nicklaus
I am trying to make a simple site map - from a directory full of files.. but I have too many files in the folder, I need pagination.. I have no idea how to do this without MySQL.
PHP Code:
<?php
$filearray = array(); if ($fil = opendir("directory/")) {
while (($file = readdir($fil)) !== false) {
if ($file != "." && $file != "..") { $filearray[] = $file;
echo "<a href="http://www.mydomain.com/directory/$file">http://www.mydomain.com/directory/$file</a><br>";
[code]...
|
Perhaps you could cache the "file listing" in a textfile and then make use of it in an array thereby be able to paginate it ?
And have a look at this function:
http://se.php.net/manual/en/function.glob.php
Itīs often underestimated.
Good luck.
__________________
Of course the whole point of a doomsday machine, would have been lost if you keep it a secret.
|
|
|
|