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