By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,521 Members | 1,447 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,521 IT Pros & Developers. It's quick & easy.

redirect print/Cannot modify header information - headers alreadysent

P: n/a
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,

Sep 25 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.