pureDesi Posted October 1, 2006 Share Posted October 1, 2006 Ok, I have a problem that I'm guessing has a very simple fix. But I can't seem to find it.This is the exact contents of the file:[code]<?setcookie("test", "", time()-30);setcookie("test", $_GET['value'], time()+30);echo $HTTP_COOKIE_VARS["test"];?>[/code]When I run it the first time, it's fine, but then everytime after that I get the following error message:[code]Warning: Cannot modify header information - headers already sent by (output started at /home2/monkey/public_html/main/test.php:3) in /home2/monkey/public_html/main/test.php on line 3[/code]Anybody know what's wrong? Link to comment https://forums.phpfreaks.com/topic/22628-cannot-modify-header-information/ Share on other sites More sharing options...
schwim Posted October 1, 2006 Share Posted October 1, 2006 Hi there,Are you sending any POST data along with the script when the next page loads? I got this same error when I was trying to use a user authorization script, and the explanation I found was that once headers are sent and page data starts to get passed, you can't go back and add any more header information.One of the solutions I found was ob_start and ob_end_flush, but I have yet to make this work successfully.thanks,json Link to comment https://forums.phpfreaks.com/topic/22628-cannot-modify-header-information/#findComment-101670 Share on other sites More sharing options...
akitchin Posted October 1, 2006 Share Posted October 1, 2006 i'm locking this topic. read the sticky topics, as they discuss header errors in detail. Link to comment https://forums.phpfreaks.com/topic/22628-cannot-modify-header-information/#findComment-101675 Share on other sites More sharing options...
Recommended Posts