Skip to content

Instantly share code, notes, and snippets.

@peet86
Forked from keriati/l.php
Created November 21, 2012 12:59
Show Gist options
  • Save peet86/4124734 to your computer and use it in GitHub Desktop.
Save peet86/4124734 to your computer and use it in GitHub Desktop.
For the silent game
<?php ini_set('display_errors', 1);error_reporting(E_ALL);
$h=$_GET['d'];$d=isset($h)?urldecode($h):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>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment