Fw: [PHP-ES] Ayuda
| From: | Antonio D . Ramírez Moreno | Date: | Mon, 05 Jul 2004 08:39:04 +0000 |
| Subject: | Fw: [PHP-ES] Ayuda | ||
| Groups: | php.general.es | ||
| Request: | Send a blank email to general-es+get-49832@lists.php.net to get a copy of this message | ||
From: "Ana"
> El error que me da es el siguiente:
> Warning: Cannot modify header information - headers already sent by
(output
> started at /var/www/girosex.com/datos/web/compra/serverbd.php:10) in
> /var/www/girosex.com/datos/web/compra/session.php on line 53
Revisa que no envíes ninguna salida de respuesta antes de hacer el
setcookie. Ese parece ser el problema.
Del manual online:
setcookie() defines a cookie to be sent along with the rest of the HTTP
headers. Like other headers, cookies must be sent before any output from
your script (this is a protocol restriction). This requires that you place
calls to this function prior to any output, including <html> and <head> tags
as well as any whitespace. If output exists prior to calling this function,
setcookie() will fail and return FALSE. If setcookie() successfully runs, it
will return TRUE. This does not indicate whether the user accepted the
cookie.