Skip to content

Instantly share code, notes, and snippets.

@keriati
Created June 6, 2012 08:45
Show Gist options
  • Save keriati/2880711 to your computer and use it in GitHub Desktop.
Save keriati/2880711 to your computer and use it in GitHub Desktop.
For the silent game
<?php ini_set('display_errors', 1);error_reporting(E_ALL);
$d=isset($_GET['d'])?urldecode($_GET['d']):dirname(__FILE__);
if(is_file($d)&&(header('Content-disposition: attachment; filename='.end(explode("/",$d)))||readfile($d)))exit();
foreach(scandir($d)as$f)echo'<li><a href="?d='.urlencode(realpath($d)."/$f")."\">$f</a></li>";
@peet86
Copy link

peet86 commented Nov 21, 2012

feat. @peet86 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment