Edit PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nyyankeefan95
Forum Newbie
Posts: 4
Joined: Tue Nov 09, 2010 6:03 pm

Edit PHP

Post 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
Post Reply