set language in session
i have 3 links that change the language.
index.php?lang=english
index.php?lang=french
index.php?lang=spanish
here is what i have but i know its not right.
$lang = $_GET['lang'];
if ($lang == 'spanish') {
$_SESSION['lang'] = 'spanish';
} else if ($lang == 'french') {
$_SESSION['lang'] = 'french';
} else {
$_SESSION['lang'] = 'english';
}
what i need is when someone comes to the site it defaults to english.
if they click on the french or spanish flag it will change the lang session and stay in the language they choose
there are other links int he site that do not have the ?lang= in the link so what is happening is it is defaulting back to english.
thank you for any help in advance.
-
layouts4you -
Thanks
{{ DiscussionBoard.errors[2340698].message }} -