ID: 51166 Updated by: [email protected] 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
