Forum Moderators: coopster
I've tried searching for pre-written php scripts that would do this, but as I don't know what to call a script like this (a 'directory contents display' script?) I have had little luck.
Does anyone know of a script out there that would do this or could some one maybe point me in the right direction to keep looking please?
Many thanks.
The directory object, created using opendir() should give you everything you need to generate a fancy page from a list of files in a particular directory...
[php.net...]
<?php
exec("ls -al .", $output, $return);
foreach ($output as $file )
print $file <br>;
?>
You should also check the $return code to make sure the ls was successful, but you get the idea. Of course, instead of just printing the file names, you could parse them and put the filename part in <a> tags so that your users could navigate to them, etc.
Shawn