#51166 [Opn->Bgs]: arning: Cannot modify header information - headers already sent by (output sta

From: Date: Sat, 27 Feb 2010 13:19:32 +0000
Subject: #51166 [Opn->Bgs]: arning: Cannot modify header information - headers already sent by (output sta
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-148108@lists.php.net to get a copy of this message
ID: 51166 Updated by: aharvey@php.net Reported By: chethan dot com at gmail dot com -Status: Open +Status: Bogus Bug Type: PHP options/info functions Operating System: windowsxp PHP Version: 5.3.1 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Please re-read the documentation for setcookie(), which notes that you can't send any output before calling it. Previous Comments: ------------------------------------------------------------------------ [2010-02-27 13:05:43] chethan dot com at gmail dot com Description: ------------ <html> <head> <title>cookie</title> </head> <body> <?php setcookie('test',45,time()+(60*60*24*7)); ?> </body> </html> my firefox , ie8 and chrome displays Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\php_sandbox\cookies.php:7) in C:\wamp\www\php_sandbox\cookies.php on line 8 please help......... Reproduce code: --------------- --- From manual page: http://www.php.net/function.setcookie --- <html> <head> <title>cookie</title> </head> <body> <?php setcookie('test',45,time()+(60*60*24*7)); ?> </body> </html> Actual result: -------------- warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\php_sandbox\cookies.php:7) in C:\wamp\www\php_sandbox\cookies.php on line 8 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=51166&edit=1

« previous php.bugs (#148108) next »