totote14 Posted October 20, 2010 Share Posted October 20, 2010 Hi to everyone, i´m developing this website for a corporation with offices in two diferent countries, so i have a select for choosing the country site to visit. Now i want to change the phisycal directory of the files when i change the optin of the select, so i can reload the other country´s page from this other directory. I was trying to do this whith a session var (php) and send it in a javascript function on the onchange event, i don´t know if this is the best option or is there another better? Thanks for your help. Quote Link to comment Share on other sites More sharing options...
Vander Posted October 20, 2010 Share Posted October 20, 2010 I'm not sure of the exact code, but you can use $_SERVER['HTTP_ACCEPT_LANGUAGE'], or maybe some other _SERVER vars to detect the language preference of the user. So basically, try to get their language, check it against an array of what languages you allow, if in the array then set their session or whatever to that language, else set it to the default language. ("en" I would assume) Hope this help, Alan. Quote Link to comment Share on other sites More sharing options...
totote14 Posted October 20, 2010 Author Share Posted October 20, 2010 Thanks, but that´s not what i want to know how to do, what i ment is that i have two directories of pho an html files which have the same name but differnt content, one of the directory is for one of the corporation site for contry one (let´s call it this way) and the other directorye contains the page for the of the second country. So, in this select i haver the two country names as options, so what i´m tryng to do is when the user changes de country option of the select, the page is reload whith the info of the country selecte, so the page that is loades is in the directory that belongs to the country selected. Thanks, Oscar. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.