Skip to content

Instantly share code, notes, and snippets.

@mhajder
Created September 19, 2017 10:04
Show Gist options
  • Save mhajder/2fd0af3534bd12bc7a82c83980235748 to your computer and use it in GitHub Desktop.
Save mhajder/2fd0af3534bd12bc7a82c83980235748 to your computer and use it in GitHub Desktop.
File to display directory content.
<html>
<body>
<br>
<table align="center" width="100%" border="0">
<tr>
<td width="10%">&nbsp;</td>
<td>
<?php
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && $file != "index.php" && $file != ".htaccess" && $file != "all.php" && $file != "index.html") {
echo "<a href=\"$file\">$file</a><br>\n";
}
}
closedir($handle);
}
?>
</td>
<td width="30%">&nbsp;</td>
</tr>
</table>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment