Page 1 of 1

PHP code for Directory Listing

Posted: March 16th, 2004, 1:44 am
by ccb056
here is a little bit of php code that I found which will allow you to do irectory listing

Code: Select all

<html>


<title>Directory listing</title>


</head>


<body>


<pre>


<?php





$thispage = basename($_SERVER['PHP_SELF'];


foreach(glob('*') as $name)


{


  if($name !== $thispage)


  {


    echo "<a href=\"$name\">$name</a>


  }


";


}


?>


</pre>


</body>


</html>

Posted: March 16th, 2004, 2:37 am
by Tebow2000
Its written in HTML tag format but php code