Jun
5
Lance asked:
I have a directory on my server with a lot of files that I want to have public. I would also like it to be protected from leeching. Any help on this would be great.
James
I have a directory on my server with a lot of files that I want to have public. I would also like it to be protected from leeching. Any help on this would be great.
James
Comments
One Response to “How do you use php to create a download list of a certain directory?”







$path = “.”;
$dir_handle = @opendir($path) or die(”Unable to open $path”);
while ($file = readdir($dir_handle)) {
if($file == “.” || $file == “..” || $file == “index.php” )
continue;
echo “$file”;
}
closedir($dir_handle);