Connecting Tech Pros Worldwide Forums | Help | Site Map

redirect print/Cannot modify header information - headers alreadysent

JRough
Guest
 
Posts: n/a
#1: Sep 26 '08
I have the following code at the end of a page that lists some query
results. It starts in a form that asks the user for input, one of two
template pages. One template is a form for user input if there is
input otherwise it changes the template and lists the results on the
other template page. That is why there is a $template variable.
====
$template = "template_carlist.html";


if ($_POST['assign']!='Open in Excel'){
include "header.php";
include "footer.php";

}else{
$file_name = str_replace('.php?','',$file_name);
printxcl($data,$header,$file_name){
}
}else{
$template = "clm_history_php.html";
}

include "header.php";
include $template_path."$template";
include "footer.php";
===
The only thing I need to fix is the printxcl function. That function
has to be redirected away from the page somehow otherwise I get an
error message because in header.php there is this line:
*header( 'Content-type: text/html; charset=\"$CHARSET\"' ) that is the
conflict.
which conflicts in the case the excel button is posted.

So I get this error in the html:

Warning: Cannot modify header information - headers already sent by
(output started at /home/allrail/public_html/templates/header.php.html:
15) in /home/allrail/public_html/header.php on line 39


So how do I do I call the print command in my excel print function
somewhere else so I don't get this conflict? Can I just redirect the
print statement?

The printxcl() needs to go to another page and not be called here
because it includes a print function and it gives me the error
message:
Line 39 is the *header line above on the header.php page.

thanks,


Closed Thread