Advertisement
brianMc

PHP File List Link Maker

Oct 21st, 2016
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.93 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.     <title>File List</title>
  5.     <link rel='shortcut icon' href='favicon.ico' type='image/x-icon'/ >
  6.     <style>
  7.         a{color: #008800;}
  8.         a:hover{font-size: 22px;}
  9.         a:active{font-size: 18px;}
  10.         a:visited{color: #006400;}
  11.     </style>
  12.     </head>
  13.     <body style="background-color: #000000; color: #00FF00; font-size: 20px; font-family: Sans-Serif;">
  14.     <div style="margin-left: 50px;">
  15.         <p><strong>File List</strong></p>
  16.         <p style="margin-top: -15px; margin-bottom: 3px;"><small>sorted alphabetically</small></p>
  17.         <?php
  18.             $files = array_diff(scandir(getcwd()), array('..', '.','.htaccess','index.html','index.php','favicon.ico'));
  19.             sort($files);
  20.  
  21.             foreach($files as $file) {
  22.                 if (is_dir($file)) {
  23.                     print "<a target=\"_blank\" href=\"{$file}\">$file</a> - directory<br />";
  24.                 } else {
  25.                     print "<a target=\"_blank\" href=\"{$file}\">$file</a><br />";
  26.                 }              
  27.             }
  28.         ?>
  29.     </div>
  30.     </body>
  31. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement