0
I have a problem with the site’s languages, it has 4 languages and when you click on the other languages there are times that it exchanges and most of the time it does not exchange, I do not know if the information is stored in the cache. I was not the one who developed the site so it gets a little more complicated to pass here, in case some information lacks tell me that I look for.
Here is the language mapping
<map name="MapIdioma">
<area shape="rect" coords="0,2,19,19" href="index.php?idioma=portugues">
<area shape="rect" coords="24,2,43,18" href="index.php?idioma=english">
<area shape="rect" coords="46,2,66,19" href="index.php?idioma=espanol">
<area shape="rect" coords="69,2,89,17" href="index.php?idioma=alemao">
</map>
And here are the sessions that begin
if ($_REQUEST['idioma'] == 'portugues')
{
$_SESSION['idIdioma'] = '1';
/*header ("Location: ".$_SERVER['HTTP_REFERER']);*/
echo "<script>document.location='".$_SERVER['HTTP_REFERER']."'</script>";
exit();
}
if ($_REQUEST['idioma'] == 'english')
{
$_SESSION['idIdioma'] = '2';
/*header ("Location: ".$_SERVER['HTTP_REFERER']);*/
echo "<script>document.location='".$_SERVER['HTTP_REFERER']."'</script>";
exit();
}
if ($_REQUEST['idioma'] == 'espanol')
{
$_SESSION['idIdioma'] = '3';
/*header ("Location: ".$_SERVER['HTTP_REFERER']);*/
echo "<script>document.location='".$_SERVER['HTTP_REFERER']."'</script>";
exit();
}
if ($_REQUEST['idioma'] == 'alemao')
{
$_SESSION['idIdioma'] = '4';
/*header ("Location: ".$_SERVER['HTTP_REFERER']);*/
echo "<script>document.location='".$_SERVER['HTTP_REFERER']."'</script>";
exit();
}
if (!session_is_registered('idIdioma'))
$_SESSION['idIdioma'] = '1';
if ($_SESSION['idIdioma'] != '1' and $_SESSION['idIdioma'] != '2' and $_SESSION['idIdioma'] != '3' and $_SESSION['idIdioma'] != '4')
$_SESSION['idIdioma'] = '1';
if ($_SESSION['idIdioma'] == '1')
include 'idioma.portugues.php';
if ($_SESSION['idIdioma'] == '2')
include 'idioma.ingles.php';
if ($_SESSION['idIdioma'] == '3')
include 'idioma.espanhol.php';
if ($_SESSION['idIdioma'] == '4')
include 'idioma.alemao.php';
?>
Off-line:
english
,espanol
,alemao
,portugues
? Set a default for language names. Suggestion:english
,espanol
,deutsch
,portugues
.– Guilherme Oderdenge
Some reason why idIdiome is a string and not an integer? By the way, relying too much on HTTP_REFERER is problematic. http://stackoverflow.com/questions/5934747/is-serverhttp-referer-safe (link in English, the first two answers are of interest)
– luiscubal