Voodoo Jai Posted July 8, 2008 Share Posted July 8, 2008 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 More sharing options...
PFMaBiSmAd Posted July 8, 2008 Share Posted July 8, 2008 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. Link to comment https://forums.phpfreaks.com/topic/113802-solved-serve-error-msg-on-redirect/#findComment-584807 Share on other sites More sharing options...
Voodoo Jai Posted July 8, 2008 Author Share Posted July 8, 2008 Fixed and working like a good one many thanks for your help. VoodooJai Link to comment https://forums.phpfreaks.com/topic/113802-solved-serve-error-msg-on-redirect/#findComment-584868 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.