Advertisement
Cyb3rJunki3

Untitled

Sep 18th, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. <?php
  2. // open this directory
  3. $myDirectory = opendir(".");
  4.  
  5. // get each entry
  6. while($entryName = readdir($myDirectory)) {
  7. $dirArray[] = $entryName;
  8. }
  9.  
  10. // close directory
  11. closedir($myDirectory);
  12.  
  13. // count elements in array
  14. $indexCount = count($dirArray);
  15.  
  16. // sort 'em
  17. sort($dirArray);
  18.  
  19. // print 'em
  20. print("<TABLE border=1 cellpadding=5 cellspacing=0 class=logs>\n");
  21. print("<TR class=logs><TH class=logs>$indexCount Log Files</TH></TR>\n");
  22.  
  23. // loop through the array of files and print them all
  24. for($index=0; $index < $indexCount; $index++) {
  25. if (substr("$dirArray[$index]", 0, 1) != "."){ // don't list hidden files
  26. print("<TR><TD><a href=\"$dirArray[$index]\">$dirArray[$index]</a></td>");
  27. }
  28. }
  29. print("</TABLE>\n");
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement