Ver Mensaje Individual
  #5 (permalink)  
Antiguo 26/01/2013, 19:20
Sard
 
Fecha de Ingreso: marzo-2008
Mensajes: 105
Antigüedad: 16 años, 1 mes
Puntos: 0
Respuesta: Mejor metodo para hacerlo

El caso es que sigo teniendo problemas, he probado un codigo de php.net:
Cita:
<?php
// crear las cookies
setcookie("cookie[tres]", "cookietres");
setcookie("cookie[dos]", "cookiedos");
setcookie("cookie[uno]", "cookieuno");

// imprimirlas luego que la página es recargada
if (isset($_COOKIE['cookie'])) {
foreach ($_COOKIE['cookie'] as $name => $value) {
$name = htmlspecialchars($name);
$value = htmlspecialchars($value);
echo "$name : $value <br />\n";
}
}
?>
Y recibo estos fallos:

Warning: Cannot modify header information - headers already sent by (output started at /home/arkheclu/public_html/cookie.php:2) in /home/arkheclu/public_html/cookie.php on line 4

Warning: Cannot modify header information - headers already sent by (output started at /home/arkheclu/public_html/cookie.php:2) in /home/arkheclu/public_html/cookie.php on line 5

Warning: Cannot modify header information - headers already sent by (output started at /home/arkheclu/public_html/cookie.php:2) in /home/arkheclu/public_html/cookie.php on line 6