1. function list_files($dir)
  2. {
  3.     if(is_dir($dir))
  4.     {
  5.         if($handle = opendir($dir))
  6.         {
  7.             while(($file = readdir($handle)) !== false)
  8.             {
  9.                 if($file != “.” && $file != “..” && $file != “Thumbs.db”)
  10.                 {
  11.                     echo ‘<a target=”_blank” href=”‘.$dir.$file.'”>’.$file.'</a><br>’.”\n”;
  12.                 }
  13.             }
  14.             closedir($handle);
  15.         }
  16.     }
  17. }
(Visited 1,650 times, 3 visits today)