Skip to content

Instantly share code, notes, and snippets.

@arelthia
Last active August 29, 2015 13:56
Show Gist options
  • Save arelthia/9335831 to your computer and use it in GitHub Desktop.
Save arelthia/9335831 to your computer and use it in GitHub Desktop.
Show clickable files in directory.
<?php
$path = "http://mydomain.com/myfiles"; //Set this to where files are located;
if ($handle = opendir('.')) {
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != "..") {
$fullentry = $path.'/'.$entry;
echo "<a href='".$fullentry."'>".$entry."</a><br />";
}
}
closedir($handle);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment