$filename=$_GET["file"]; $dir="log/"; $file = $dir.$filename; header('Content-type: application/txt'); header('Content-Disposition: attachment; filename='.$file.''); readfile($file);