Select Language [select form]
Posted: Fri Feb 20, 2009 5:33 pm
Hi, It's been a while since I touched php.. so forgive my noobness.
I want a simple redirect depending on the value of the select.
if french / if english meta refresh to this url.
The form
the php, I get the logic just cant put it in code, I guess the first problem is that by default, the value will be set to english, so I have to check what is the value
if its english I have to make sure it has been switched from a french page meaning the value was french before...but not sure how to do that.
any help would be welcome.
my actual code (obviously not working) is this
I want a simple redirect depending on the value of the select.
if french / if english meta refresh to this url.
The form
Code: Select all
Language :
<form action="<?php echo $PHP_SELF;?>" method="post">
<select name="lang" onchange="this.form.submit()">
<option value="english">English</option>
<option value="francais">Français</option>
</select>
</form>
Code: Select all
if(isset($lang)){any help would be welcome.
my actual code (obviously not working) is this
Code: Select all
$lang=$_REQUEST['lang'];
if($lang='francais'){
print "<meta http-equiv='refresh' content='0; url=http://my-url-here.php'>";
}