//define the path as relative
$path = "/home/dardenne/WWW/files";
//using the opendir function
$dir_handle = @opendir($path) or die("Unable to open $path");
echo "
Directory Listing
\n";
//running the while loop
echo "
\n";
while ($file = readdir($dir_handle))
{
if($file != ".") if ($file != "..")
echo "- $file
\n";
}
echo "
\n";
//closing the directory
closedir($dir_handle);
?>