Ver Mensaje Individual
  #9 (permalink)  
Antiguo 13/11/2007, 04:47
Avatar de jorjo
jorjo
 
Fecha de Ingreso: abril-2007
Ubicación: España
Mensajes: 90
Antigüedad: 17 años
Puntos: 1
Re: Guardar y leer de una cookie

Bueno, pues lo he solucionado así:

index.php
Código PHP:
if($HTTP_COOKIE_VARS["idioma"] == "cat"){
    
header("Location: http://www.dominio.com/index-cat.php");
    exit;
}elseif (
$HTTP_COOKIE_VARS["idioma"] == "esp"){
    
header("Location: http://www.dominio.com/index-esp.php");
    exit;
}elseif (
$HTTP_COOKIE_VARS["idioma"] == "eng"){
    
header("Location: http://www.dominio.com/index-eng.php");
    exit;

index-cat.php
Código PHP:
header("Content-Type: text/html; charset=utf-8");
setcookie("idioma""cat"time()+604800); 
index-esp.php
Código PHP:
header("Content-Type: text/html; charset=utf-8");
setcookie("idioma""esp"time()+604800); 
index-eng.php
Código PHP:
header("Content-Type: text/html; charset=utf-8");
setcookie("idioma""eng"time()+604800); 
Un saludo