Hi Im working on some language selection in a website, so far it is working wery well exept i cant get it to remember the chosen language when changing pages, im thinking it must be done by either using a session or a cookie but im stuck atm. Here is my code. PHP: <?php //language $languages = array( 'en' => 'english', 'dk' => 'danish', ); if (isset($_GET['lang']) AND array_key_exists($_GET['lang'], $languages)) { include './lang/' . $languages[$_GET['lang']] . '.php'; } else { include './lang/english.php'; } ?> And to change the language im just using simple links PHP: <a class="link" href="<? echo $_SERVER[PHP_SELF];?>?lang=dk"><?php echo $lng['danish']; ?></a> <a class="link" href="<? echo $_SERVER[PHP_SELF];?>?lang=en"><?php echo $lng['danish']; ?></a> Any ideas ??
Create a session in PHP. This page has a simple example: http://de3.php.net/manual/en/function.session-start.php