Hi all,
I have a PHP script that is split into 2 parts; first, the user input is analyzed and a txt file is made; second, the remainder of the script generates some HTML output that is displayed.
It looks like the HEADER stuff for the txt file causes the script to stop after the file is produced, and the remainder of the script isn't run. Is there any work around?
-
$filename = "output";
-
$ext = "txt"; // file extension
-
$mime_type = (PMA_USR_BROWSER_AGENT == 'IE' || PMA_USR_BROWSER_AGENT == 'OPERA')
-
? 'application/octetstream'
-
: 'application/octet-stream';
-
header('Content-Type: ' . $mime_type);
-
if (PMA_USR_BROWSER_AGENT == 'IE')
-
{
-
header('Content-Disposition: inline; filename="' . $filename . '.' . $ext . '"');
-
header("Content-Transfer-Encoding: binary");
-
header('Expires: 0');
-
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
-
header('Pragma: public');
-
} else {
-
header('Content-Disposition: attachment; filename="' . $filename . '.' . $ext . '"');
-
header("Content-Transfer-Encoding: binary");
-
header('Expires: 0');
-
header('Pragma: no-cache');
-
}
-
Thanks!