Headers already sent
| From: | Kranthi Krishna | Date: | Fri, 11 Nov 2011 06:12:51 +0000 |
| Subject: | Headers already sent | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-315635@lists.php.net to get a copy of this message | ||
Hi all,
I am missing something pretty obvious here. The PHP Manual says
"Remember that header() must be called before any actual output is
sent, either by normal HTML tags, blank lines in a file, or from
PHP.". A simple test case shows otherwise
I have the following code
test
<?php
setcookie("TestCookie", 'test');
nothing more nothing less.. only this code in a file
I get the output in the browser ("test") AND the cookie is set
(verified by live HTTP headers). Any ides on why this is happening ?
Linux localhost 2.6.40-4.fc15.i686 #1 SMP Fri Jul 29 18:54:39 UTC 2011 i686
Apache 2.0 Handler
Zend Engine v2.3.0, Xdebug v2.1.2
PHP 5.3.6
Kranthi.
http://goo.gl/e6t3