Page 1 of 1

Edit PHP

Posted: Wed Nov 10, 2010 5:48 pm
by nyyankeefan95

Code: Select all

<?php
if ($handle = opendir('.')) {
   echo "<ul>";
    while (false !== ($file = readdir($handle))) {
        if ($file != "." && $file != "..") {
            echo "<li>$file</li>";
        }
    }
   echo "</ul>";
    closedir($handle);
}
?>
The code above shows files in a directory. What do i have to do to this code to make it show "Index of /" At the very top and make the text clickable to show the file/folder directory?

Thanks