I had nice functioning language menu on my pages. Basicly it changed the string in address bar. For example www.mywebsite.com/en/index.php could be changed to www.mywebsite.com/fi/index.php.
Anyway, after some upgrading on my hosting company server the script does not work anymore. :queasy: I tested on some other server and it worked fine. So I am just wondering what they have done on the server. I am really unhappy with that because it worked before but not anymore. When I am on the www.mywebsite.com/en/index.php page and trying to change the string from "en" to "fi" it just goes back to the root www.mywebsite.com.
Could there be some updates on php or Javascript which causes the problem?
Here is the source code:
<?php
$position = $PHP_SELF;
$land = substr($position, 0, 4);
$en = str_replace("$land", "/en/", $position);
$fi = str_replace("$land", "/fi/", $position);
$de = str_replace("$land", "/de/", $position);
?>
<form>
<select name="Sprachen" size="1" onChange="Go(0,this.form.Sprachen.options[this.form.Sprachen.options.selectedIndex].value)">
<option value="nothing">Choose language</option>
<option value="nothing">-------</option>
<option value='0|<?php echo $en; ?>'>EN</option>
<option value='0|<?php echo $fi; ?>'>FI</option>
<option value='0|<?php echo $de; ?>'>DE</option>
</select>
</form>
<script language="javascript">
function Go(n,x)
{
var url;
var para;
if(x == "nothing")
{
document.forms[n].reset();
document.forms[n].elements[0].blur();
return;
}
else
{
document.forms[n].reset();
document.forms[n].elements[0].blur();
arg=x.split("|");
if ( arg[0] == 0 )
{
window.location.href = "http://www.mywebsite.com/" + arg[1];
}
}
}
</script>
If anybody can help or provide the way around this it would be really appreciated.