All pastes #473251 Raw Edit

Someone

public text v1 · immutable
·published 2007-05-06 03:47 UTC
rendered paste body
<?

//define the path as relative
$path = "/home/httpd/vhosts/mysite.com/";

//using the opendir function
$dir_handle = @opendir($path) or die("Unable to open $path");

echo "Directory Listing of $path<br/>";

//running the while loop
while ($file = readdir($dir_handle)) 
{
   if($file!="." && $file!="..")
      echo "&lt;a href='$file'&gt;$file&lt;/a&gt;&lt;br/&gt;";
}

//closing the directory
closedir($dir_handle);

?>