opportunity to save a file and at the same time see new information on
the screen.
I can do it seperately, but not together. What I have is the following:
@ob_end_clean();
$SHOW = "1";
if ($SHOW == 1) {
// Show all the info on a page
$TEXT = $TEXT."<pre>".$LINE."</pre>"; // $TEXT = website data
// $LINE = new content
include("../main_text2.inc"); // HTML Layout
} else {
// Save the file
$length = strlen($LINE);
header('Last-Modified: '.date('r'));
header('Accept-Ranges: bytes');
header('Content-Length: '.$length);
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="'.$filename.'.itn"');
print $LINE; // $LINE = new content
}
When I change the "1" into a "0" it will save the file. So sperately
this works, but together it doesn't. When I try it together I get the
error with each header: <b>Warning</b>: Cannot modify header
information - headers already sent by (output started at header.inc:3)
in <b>test02.php</bon line <b>133</b><br />
header.inc (which is an include in main_text2.inc) cointains:
<html>
<head>
<title><?php print $TITLE; ?></title>
<link rel="stylesheet" title="Shell (Default)" type="text/css"
href="/style.css" media="screen">
<link rel="alternate stylesheet" title="Newer" type="text/css"
href="/new_style.css" media="screen">
</head>
<body>
<div id="page">
So what can I do do first show the info and when the page is loaded give
the visitor the ability to save the file?
houghi
--
> Beware of he who would deny you access to information, <
for in his heart he dreams himself your master. <
Commissioner Pravin Lal: "U.N. Declaration of Rights" <