Hi. I’m no guru of php, so I don’t even know if the code I wrote and will show bellow is even right. Can one have ifs inside ifs? If not, what other way do I have to do this?
Apparently it’s not working.
Thanks
[php]<?php
$langcode = substr($_SERVER[‘HTTP_ACCEPT_LANGUAGE’], 0, 2);
if ($_SESSION[‘lang’]==’’)
{ if ($langcode = ‘fr’) { $lang=$langcode; }
else
{ if ($langcode = ‘pt’) {
$lang = ‘pt’; }
else
{ $lang = ‘en’; }
}
}
else {
$lang=$_SESSION[‘lang’];
}
?>[/php]