Skip to content

Instantly share code, notes, and snippets.

@walterdavis
Last active December 10, 2015 00:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save walterdavis/4355006 to your computer and use it in GitHub Desktop.
Save walterdavis/4355006 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Directory Listing</title>
<base target="_blank" />
</head>
<body>
<?php
$out = '';
foreach(scandir(dirname(__FILE__)) as $file){
if((substr($file, 0, 1) != '.') && ($file != basename(__FILE__))){
$out .= '<p><a href="' . $file . '">' . $file . '</a></p>' . "\n";
}
}
print $out;
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment