View Single Post
Old 11-21-2011, 10:58 AM   #30 (permalink)
EyeDentify
The Acquainted
 
EyeDentify's Avatar
 
Join Date: Nov 2007
Location: Sweden
Posts: 106
Thanks: 13
EyeDentify is on a distinguished road
Default

Quote:
Originally Posted by Nicklaus View Post
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.
EyeDentify is offline  
Reply With Quote