From the computer of: qmchenry
(338 recipes)
Created: Jul 10, 2006
PHP handles lots of the work of generating web pages for you, without you even having to ask. A web page is composed of two parts, the header and the body.
The header is generally stuff that you don't need to worry about, is generated automatically, and contains information about the page, the server, related cookies, and so on. The header information is important, but it is not typically seen by the user. Here are some examples:
Sometimes programmers want to change some of the header values. For example, if the PHP if generating XML output, the Content-Type should be changed to reflect this. Another common example is in redirecting the user's browser to a different web page using the Location header element as described in this Tech-Recipe.
The header must come first in the response from a web server and is separated from the body by one blank line. The reason this error occurs is that some part of the body of the web page has been sent to the user already when a request is made to set a header value. Because PHP simplifies many things for you, the problem may be hiding in plain site. Here are some guidelines for finding the problem:
Subscribe to the Tech-Recipes Newsletter
You can get tips like this delivered in your email every week!
We will never, ever sell your email address or spam you.
3 Recipe comments: View comments
Solve PHP error: Cannot modify header information - headers by noman
Cannot modify header information solution (only suggestion) by mgingco
Re: Cannot modify header information solution (only suggesti by seema
Related recipes:
PHP: Set or create a simple browser cookie with setcookie
Redirect to another web page using PHP
Solve PHP Fatal error: Allowed memory size of 8388608 bytes exhausted (tried...
PHP: Print the current year for copyright notices
PHP: Generate Dynamic Images from Text
PHP: Upload Files to the server
PHP syntax: iterate over an associative array
PHP: determine the directory path of the server root
PHP: Delete or unlink a file on the server
PHP: Rename or move a file on the server
Sponsored links
Login
Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.Search
Tech Recipes
· Home
· Mac OS X
· Solaris
· Windows
· Programming
· UNIX
· Cisco
· MySQL
· Google
· Instant messaging
· Add recipes
· Leave feedback
· Recommend us
· RSS Syndication
Hot recipes
Make XP look like Windows Vista / Longhorn for free!
SMS through E-Mail: Cingular, Nextel, Sprint, T-Mobile, Verizon, Virgin Mobile
XP: Small, Free Way to Use and Mount Images (ISO files) Without Burning Them
Vista: Should I Install 64-bit or 32-bit Version? (x64 vs x86)
How Do I Use or Open Bin, Cue, or ISO Files?
Hacks to Beat Rapidshare Download Limits and Waiting Time
MySpace Hack: View Pictures and Comments on a Private Profile
MySpace: Hack to Download Any Song on MySpace
Who's Online
There are currently, 2843 guest(s) and 2 member(s) that are online.
You are Anonymous user. You can register for free by clicking here
Information
Wish to advertise with us?
All logos and trademarks in this site are property of their respective owner. The comments and forum posts are property of their posters, all the rest © 2003-2007 by QD Ideas, LLC.
Users of this site are legally bound by the Terms and conditions and Disclaimer. Do not use this web site if you do not agree with these policies.
The members, admins, and authors of this website respect your privacy.
Page Generation: 1.53 Seconds
Fri Aug 8 14:05:03 2008