Warning: Cannot add header information - headers already sent
From: Phyzlo (phyzlo_at_yahoo.com)
Date: 03/08/04
- Next message: Jedi121: "Re: PHP compiler"
- Previous message: Pugi!: "Office document upload to website (and inserting in MySQL if possible)"
- Next in thread: Jedi121: "Re: Warning: Cannot add header information - headers already sent"
- Reply: Jedi121: "Re: Warning: Cannot add header information - headers already sent"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 8 Mar 2004 11:16:53 -0800
Hello,
I've recently started learning PHP and have a question.
I tried running below script which can be found at
http://se2.php.net/manual/sv/function.setcookie.php
but I keep getting this message on my browser, why?
Warning: Cannot add header information - headers already sent by
(output started at /var/www/cookietest.php:2) in
/var/www/cookietest.php on line 6
Warning: Cannot add header information - headers already sent by
(output started at /var/www/cookietest.php:2) in
/var/www/cookietest.php on line 7
Warning: Cannot add header information - headers already sent by
(output started at /var/www/cookietest.php:2) in
/var/www/cookietest.php on line 8
-----
<?
echo "Setting cookie";
$value = 'Test value';
setcookie("TestCookie", $value);
setcookie("TestCookie", $value, time()+3600); /* expire in 1 hour */
setcookie("TestCookie", $value, time()+3600, "/~rasmus/",
".example.com", 1);
echo "Cookie Set!";
?>
- Next message: Jedi121: "Re: PHP compiler"
- Previous message: Pugi!: "Office document upload to website (and inserting in MySQL if possible)"
- Next in thread: Jedi121: "Re: Warning: Cannot add header information - headers already sent"
- Reply: Jedi121: "Re: Warning: Cannot add header information - headers already sent"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|