I have a script which generates a langaugefile like this: $sql = $db->sql_query("SELECT * FROM ".$prefix."_lang_code WHERE lang_id=2"); while ($row = $db->sql_fetchrow($sql)) { define("_".$row['tagname']."","".$row['string'].""); echo 'Tagname: _'.$row['tagname'].' | Text: '.$row['string'].'<br>'; } PHP: As you can see it generates the language depending on "lang_id". I want it to choose which lang_id it should use depending on first, if a cookie is active with the preferred language like this: $cookie_read = explode("|", base64_decode($user)); //define variables to hold cookie values. $userid = $cookie_read[0]; $language = $cookie_read[6]; PHP: If the cookie is not set it should look at what language browser is like this: $browser_lang = strtolower( $_SERVER["HTTP_ACCEPT_LANGUAGE"] ); PHP: And if the browsers lang is unsupported it should go to the default language which is lang_id=1. I have a db table (".$prefix."_lang_languages) with the installed language with these fields(id, lang_long, lang_short) where the lang_short field is the field that matches the browser lang id (en, de, da, se, etc...) Can this be done and if yes... how? Hope somebody can help or guide me in the right direction
http://www.tutorialized.com/view/tutorial/Redirect-Visitors-by-Browser-Language/10157 hope you get this