Advertisement
misterFanta

Shows contents of a localhost folder

Jul 2nd, 2020
1,174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.28 KB | None | 0 0
  1. <?php
  2.  
  3. if ($handle = opendir('.')) {
  4.  
  5.     while (false !== ($entry = readdir($handle))) {
  6.  
  7.         if ($entry != "." && $entry != "..") {
  8.  
  9.             echo "$entry\n<br>";
  10.             echo "<a href = '$entry'>$entry\n</a><br>";
  11.         }
  12.     }
  13.  
  14.     closedir($handle);
  15. }
  16.  
  17. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement