if((!isset($_SESSION['lang']))||(!isset($_GET['lang']))){
$_SESSION['lang'] = "en";
$currLang ="en";
} else {
$currLang = $_GET['lang'];
$_SESSION['lang'] = $currLang;
}
Assuming you're having a problem with something I'm going to point out that you fail to handle the case where the SESSION variable is set but the GET variable is not.
Assuming you want the GET variable to override the SESSION variable, and you want English for a default:
if(isset($_GET['lang'])) {
// In the real world you'd check you got
// a valid value from the user here
$_SESSION['lang'] = $_GET['lang'];
} elseif(!isset($_SESSION['lang'])) {
$_SESSION['lang'] = 'en';
}
$currLang = $_SESSION['lang'];
One more thing:
define("CHARSET","ISO-8859-1");
You might as well use UTF-8 for everything. The whole point of Unicode is to avoid needing different encodings for different languages.