Ver Mensaje Individual
  #10 (permalink)  
Antiguo 03/02/2011, 14:09
kechu
 
Fecha de Ingreso: febrero-2011
Ubicación: define ('Ubicación', 'Mi_casa');
Mensajes: 21
Antigüedad: 13 años, 2 meses
Puntos: 0
Respuesta: Problema con multilenguaje

Ok ya lo he arreglado muchas gracias ^^ .
He usado el session start y ya se como hacerlo y me va perfectamente.

Aqui el codigo por si alguien lo necesita como yo lo necesitaba xD
Código PHP:
<?php 
session_start 
();
if (
$_GET["idioma"]) {
    
$_SESSION["idiomas"] = $_GET["idioma"];
}
elseif (!
$_SESSION["idiomas"]) {
    
$_SESSION ["idiomas"] = "es";
}
// Include con idioma
include("lang_".$_SESSION["idiomas"].".php");    
?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="style.css" rel="stylesheet" type="text/css" />
<title><?php echo $idioma['title']; ?></title>
</head>

<body id="inicio">
<div id="wrapper">
<div id="cabecera">
<a href=""> <img src="logo.gif" title="" /></a>
<p> <?php echo $idioma['eslogan']; ?> </p>
</div>
<div id="naveg">
<ul id="menu">
<li id="nav01"><a href="index.php"><?php echo $idioma['index']; ?></a></li>
<li id="nav02"><a href="/contacto/contacto.php"><?php echo $idioma['contacto']; ?></a></li>
</ul>
</div>
<div id="areatexto">
<h2><?php echo $idioma['index']; ?> </h2>
<div id="spoiler">
<div class="pre-spoiler">
<span style="float:left; padding-top: 2px;"></span> <input type="button" value="Mostrar" style="width:80px;font-size:10px;margin:0px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';this.innerText = ''; this.value = 'Esconder'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.value = 'Mostrar';}">
</div>
<div>
<div class="spoiler" style="display: none;"><br />
<h1> <?php echo $idioma['construccion']; ?></h1> <br />
</div>
</div>
</div>


<p>!Hola! Esta web est&aacute; en construcci&oacute;n. Por favor, tengan paciencia, pronto estar&aacute; terminada.</p>
<ul><?php // Estos textos no los sustituímos porque son los nombres de los idiomas en el idioma al que apuntan y producen el cambio de idioma. ?> 
 <?php echo "<p><a href='index.php?idioma=en'?>".$idioma['en']."</a>";
        echo 
"<p><a href='index.php?idioma=es'?>".$idioma['es']."</a>";?>
</ul>
</div>