![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
16/11/2004, 11:41
|
![Avatar de ignacio_giri](http://static.forosdelweb.com/customavatars/avatar31254_1.gif) | | | Fecha de Ingreso: febrero-2003 Ubicación: Argentina, Rosario
Mensajes: 585
Antigüedad: 22 años Puntos: 0 | |
//session.php
<?php
session_start();
if (!$sitestyle) $sitestyle ="es";
include ("VarsMM.php");
dbconnect();
?>
//en cualquier pagina, colocar los 2 idiomas
<?php
if ($sitestyle == "es") echo "NUEVO" ;
if ($sitestyle == "en") echo "NEW" ;
?>
//cambiar idioma.php
<?php
// $set = $_GET['set'];
$set=$HTTP_GET_VARS["set"];
$set = preg_replace('#[^a-zA-Z0-9_-]#', '', $set);
setcookie ('sitestyle', $set, time()+31536000, '/', 'sitio.com', '0');
header("Location: $HTTP_REFERER");
?>
//script cambiar idioma
<?php
/*
$set = $_GET['set']; // no funciona en php 4.0.6, si en php 4.3.2
$set=$HTTP_GET_VARS["set"];
$set = preg_replace('#[^a-zA-Z0-9_-]#', '', $set);
setcookie ('sitestyle', $set, time()+31536000, '/', '.es', '0');
header("Location: $HTTP_REFERER");
*/
echo $set;
?>
__________________ Ignacio |