Sunday, 4 December 2011

PHP redirection through header() function not working?

header("Location: http://dirtyhandsphp.blogspot.com/");

While using header function sometimes you got the error like: 'Cannot add/modify header information – headers already sent by…' 

To avoid such situation you can use output buffering or just make sure that nothing was sent to the client. 

Remember also that headers MUST be sent before any output is started. There are no exceptions from this rule, in fact you cannot even sent a blank line to the output, executing code like this:

echo ""; 


No comments:

Post a Comment

Thanks for your valuable comments.

Gmail: Download blocked file

Hi, today we are going to learn, how to download blocked file in gmail. Sometimes you see following message in gmail: and you can...