UnixServerAdmin

Server Administration & Management

PHP Error: Cannot modify header information

The header is generally stuff that you don’t need to worry about, is generated automatically, and contains information about the page, Ucvhost web server the header must come first in the response from UCVHOST’s 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. there are some guidelines for finding the problem:

1) Find the header() statement that is causing the problem. The error must be at or before this line.

2) Look for any statements that could send output to the user before this header statement. If you find one or more, find some way to move the header statement before them. Complex conditional statements may complicate the issue, but they may also help solve the problem. Consider a conditional expression at the top of the PHP script that determines the header value as early as possible and sets it there.

3) Make sure there is no white space outside of the php start and end tags.

Advertisements

March 30, 2011 - Posted by | PHP |

1 Comment »

  1. Your information truly fills a necessity. I’ve been hoping to find this specific article and you really came through. Can you believe that everything you have written pretty much precisely duplicates my personal experience.

    Comment by amazing water blog | June 16, 2011 | Reply


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: