directory
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
Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google

Comments

One Response to “How do you use php to create a download list of a certain directory?”

  1. aryaxt on June 8th, 2009 7:15 pm

    $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);