Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // open this directory
- $myDirectory = opendir(".");
- // get each entry
- while($entryName = readdir($myDirectory)) {
- $dirArray[] = $entryName;
- }
- // close directory
- closedir($myDirectory);
- // count elements in array
- $indexCount = count($dirArray);
- // sort 'em
- sort($dirArray);
- // print 'em
- print("<TABLE border=1 cellpadding=5 cellspacing=0 class=logs>\n");
- print("<TR class=logs><TH class=logs>$indexCount Log Files</TH></TR>\n");
- // loop through the array of files and print them all
- for($index=0; $index < $indexCount; $index++) {
- if (substr("$dirArray[$index]", 0, 1) != "."){ // don't list hidden files
- print("<TR><TD><a href=\"$dirArray[$index]\">$dirArray[$index]</a></td>");
- }
- }
- print("</TABLE>\n");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement