#19063 [NEW]: Can't set any cookie. Received error warning about header.

From: Date: Fri, 23 Aug 2002 07:38:28 +0000
Subject: #19063 [NEW]: Can't set any cookie. Received error warning about header.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-17614@lists.php.net to get a copy of this message
From: h_tr_dung@hotmail.com Operating system: WinXP Pro. and FreeBSD 4.6 PHP version: 4.2.2 PHP Bug Type: HTTP related Bug description: Can't set any cookie. Received error warning about header. I have tested the "baking" file (please see below) in two machines and received the same error: Warning: Cannot add header information - headers already sent by (output started at ...\setcookie.php:1) in ...\setcookie.php on line 2 The first system used: WinXP Pro., IIS (built-in with WinXP). The second system used: FreeBSD 4.6, Apache/1.3.26. The "baking" file's content: <?php setcookie ("Chip_Name",$Chip); echo "<BODY OnLoad=\" location='".$forwarding."' \">"; ?> The test file's content: <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <?php echo $Chip_Name; ?> <a href="setcookie.php?Chip=Chocolate&forwarding=<?php echo $PHP_SELF ?>">Test SetCookie() Function</a> </body> </html> Is it a bug?!? Or there is something wrong with my code?!? I couldn't even "bake" any cookie because some headers were sent first, but how could? -- Edit bug report at http://bugs.php.net/?id=19063&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=19063&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=19063&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=19063&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=19063&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=19063&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=19063&r=support Expected behavior: http://bugs.php.net/fix.php?id=19063&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=19063&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=19063&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=19063&r=globals

« previous php.bugs (#17614) next »