I am using the following code to pull a list of all files in a directory:
<?
if ($handle = opendir('directory_here/')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo $file . "<br>";
}
}
}
closedir($handle);
?>
I figured this one out, but I still have other questions below This works well, but it lists ALL files in the directory, including sub directories, php files, and .htaccess files. Is there a way to alter this script so it will only list .html files?
Also, is there a way to limit the display to 50 files, before it displays a link to another page with 50 more?
Finally, is there a way to display the output newest to oldest?
Thanks in advance.
Frank