Re: Headers already sent

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Perhaps your server is configured to have output buffering enabled by default? Check php.ini / phpinfo().

--Larry Garfield

On 11/11/2011 12:12 AM, Kranthi Krishna wrote:
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


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux