Hello there, I have this little annoying issue with a session. I'm trying to make a very simple language system. Here's what I got so far: <? $_SESSION['lang'] = $_GET['lang']; if ($_SESSION['lang'] == "en") { include('languages/en/en.php'); echo 'EN'; } else { include('languages/nl/nl.php'); echo 'NL'; } ?> PHP: This file is called languages.php and gets included in EVERY page on the site. Now when I add the text ?lang=en behind an URL it shows the language EN correctly. And ?lang=nl shows the language NL correctly. So the script works fine. However, when I leave that current page, the session doesn't hold the current language and switches back to the default one. Yes, in every page it says session_start(); Can anyone help me out, am I missing something? Thanks, Miquexia.
I think this line causing problem $_SESSION['lang'] = $_GET['lang']; PHP: try replacing it with if(isset($_GET['lang']) && $_GET['lang']!="") $_SESSION['lang'] = $_GET['lang']; PHP: