Jump to content

[SOLVED] Serve Error msg on redirect


Voodoo Jai

Recommended Posts

I have tested a php file on my own server and everything works fine but when I upload the file I get this

 

Warning: Cannot modify header information - headers already sent by (output started at /hsphere/local/home/poochima/lostmymenu.com/takeaway.php:96) in /hsphere/local/home/poochima/lostmymenu.com/takeaway.php on line 2132

 

the page is supposed to redirect a user to another page .

 

Thanks

 

VoodooJai

Link to comment
https://forums.phpfreaks.com/topic/113802-solved-serve-error-msg-on-redirect/
Share on other sites

The server where this works has got output buffering turned on in php.ini. The server where it does not has got output buffering turned off.

 

Your code is outputting content at or before line 96. This prevents the redirect header from being sent. It is better to write code that does not output content when a redirect will occur. Do this by putting any logic that figures out the redirect first on the page. This results in the quickest page operation.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.