Código PHP:
<?
echo"$_COOKIE[lang]";
if($_COOKIE[lang] !== "") {
if(($_GET[lang] == "es") && ($_GET[change] == "yes")) {
setcookie("lang",0,(time()-1));
header("Location:index.php");
setcookie("lang",es,time()+3600*24*365); }
if(($_GET[lang] == "en") && ($_GET[change] == "yes")) {
setcookie("lang",0,(time()-1));
header("Location:index.php");
setcookie("lang",en,time()+3600*24*365);
} }
else {
if(($_GET[lang] == "es") && ($_GET[change] == "yes")) {
setcookie("lang",es,time()+3600*24*365); }
if(($_GET[lang] == "en") && ($_GET[change] == "yes")) {
setcookie("lang",en,time()+3600*24*365);
}
}?>
Me salta:
Warning: Cannot modify header information - headers already sent by (output started at /home/virtual/sitio155819/www/lan2.php:2) in /home/virtual/sitio155819/www/lan2.php on line 5
Warning: Cannot modify header information - headers already sent by (output started at /home/virtual/sitio155819/www/lan2.php:2) in /home/virtual/sitio155819/www/lan2.php on line 6
Como podría eliminar la cookie o hacer que el script funcionase?
Gracias de antemano