Re: SetCookie
| From: | Mattias Segerdahl | Date: | Wed, 22 Nov 2000 13:11:37 +0000 |
| Subject: | Re: SetCookie | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-26625@lists.php.net to get a copy of this message | ||
Then don't set it after the body tag, cookies and headers need to be set
before you send any output to the browser.
From the documentation:
Setcookie() defines a cookie to be sent along with the rest of the header
information. Cookies must be sent before any other headers are sent (this is
a restriction of cookies, not PHP). This requires you to place calls to this
function before any <html> or <head> tags.
// Mattias aka bad2da
----- Original Message -----
From: "Alaiddin Tayeh" <atayeh@p-i-s.com>
To: <php-general@lists.php.net>
Sent: Wednesday, November 22, 2000 2:15 PM
Subject: [PHP] SetCookie
> Hello,
> I put the setcookie() function after the body tag, and get this warning,
>
> ((Warning: Oops, php3_SetCookie called after header has been sent in
> /path/to/myfile.php3 on line 8))
> any hints??
> thanks
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>