Jump to content

Change Web Site Country


totote14

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.