#19063 [Opn->Fbk]: Can't set any cookie. Received error warning about header.
| From: | rasmus@php.net | Date: | Fri, 23 Aug 2002 14:32:56 +0000 |
| Subject: | #19063 [Opn->Fbk]: Can't set any cookie. Received error warning about header. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-17659@lists.php.net to get a copy of this message | ||
ID: 19063
Updated by: rasmus@php.net
Reported By: h_tr_dung@hotmail.com
-Status: Open
+Status: Feedback
Bug Type: HTTP related
Operating System: WinXP Pro. and FreeBSD 4.6
PHP Version: 4.2.2
New Comment:
It is very very unlikely that there is a PHP bug here. You probably
have something before the opening <?php tag in the file that sets the
cookie. Put up a .phps or a .zip file somewhere with the actual files
in question so we can have a look. And when we do explain your mistake
to you, you can apologize nicely to sniper.
Previous Comments:
------------------------------------------------------------------------
[2002-08-23 10:11:47] h_tr_dung@hotmail.com
My code has nothing wrong (as you can see)! This was a bug and I
reported it. However, I guess I should have done it with an aggresive
tone to get more attention from you.
Cheer
------------------------------------------------------------------------
[2002-08-23 07:15:40] sniper@php.net
Sorry, but the bug system is not the appropriate forum for asking
support questions. Your problem does not imply a bug in PHP itself.
For a list of more appropriate places to ask for help using PHP,
please visit http://www.php.net/support.php
Thank you for your interest in PHP.
------------------------------------------------------------------------
[2002-08-23 03:38:27] h_tr_dung@hotmail.com
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 this bug report at http://bugs.php.net/?id=19063&edit=1