473,657 Members | 2,825 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

redirect print/Cannot modify header information - headers alreadysent

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_carli st.html";
if ($_POST['assign']!='Open in Excel'){
include "header.php ";
include "footer.php ";

}else{
$file_name = str_replace('.p hp?','',$file_n ame);
printxcl($data, $header,$file_n ame){
}
}else{
$template = "clm_history_ph p.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=\"$CHAR SET\"' ) 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
0 2110

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
8005
by: Damo | last post by:
Could someone please help me. I am a newbie at PHP. I downloaded formail.php Version 5.0 from Jacks scripts( http://www.dtheatre.com/scripts/ )and changed the required areas to my email address and the domain server address. (these changes were in the $recipient and $referers section) I have set up the form and can get the form to email me the results. I have two main problems. The first one is that I am trying to get the form to go to a...
19
2968
by: soham | last post by:
I want to redirect to another file, isn't this the right code to do so header("Location:http://".$_SERVER.dirname($_SERVER)."/images/$file_name"); the interpreter give me this erorr instead of redirecting Warning: Cannot modify header information - headers already sent by (output started at E:\tryphp\direct.php:9) in E:\tryphp\direct.php on line 70
7
11154
by: deko | last post by:
I have a login page that is supposed to redirect the user to his private page after login. But header("Location: $url") does not work after I set the $_SESSION variable - I get "Warning: Cannot modify header information - headers already sent by ... The abbreviated code on the login page looks like this: <?php session_start(); ?>
3
3314
by: Greg Scharlemann | last post by:
Does the redirect statement: header(Location:"http://www.newpage.com"); need to come before certain statements? I've setup a login page and try to redirect a user once they have logged in (after I set the appropriate $_SESSION value) but I get the following error: Warning: Cannot modify header information - headers already sent by (...)
8
24266
by: Andreas Klemt | last post by:
Hello, I get this error Message "cannot redirect after http headers have been sent" when I do this response.redirect ("home.aspx") How can I find out with vb.net if already a http header has been sent like If response.IsSentHttpHeader then ....
19
7918
by: lawrence k | last post by:
How can I find out where my script is outputting to the screen for the first time? My error logs are full of stuff like this: PHP Warning: session_start(): Cannot send session cache limiter - headers already sent in /home/httpd/vhosts/monkeyclaus.org/httpdocs/media/audio/pdsIncludes/CommandStartSession.php on line 14
2
1481
by: pks83 | last post by:
Hello I am also facing this problem when i amtrying to send additional header information. Warning: Cannot modify header information - headers already sent by (output started at header.php:96) in my.class.php on line 1198 What is happening over here is that i when i am trying to download an attached file i am passing the additional header information which is conflicting with the header info which has already being sent before. ...
18
2661
by: Paul Lautman | last post by:
JRough wrote: What do you mean by "redirect the output to Excel"??? Excel isn't a location, it's a spreadsheet program that some (but not all users) will have on their machine. BTW, Location: is supposed to take a fully qualified URL.
2
2170
by: JRough | last post by:
I have this code that switches templates depending on if the user fills in a form with a request. The request asks for the $mark & $number. If that request gets input then it displays a list otherwise it re-displays the form request. The $template variable changes the value of which template is displayed. if($mark&&$num){ $mark = $mark = strtoupper($mark); $TPL_carnumbers = GetHeaders($_SESSION); $xclheader =
0
8403
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8316
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8833
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8737
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8610
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6174
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4327
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2735
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1730
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.