...

View Full Version : Detect regional settings



sarah
03-03-2003, 01:07 PM
Hi All,

Is there any way of detecting regional settings using PHP, ASP, JSP? What I want to do is when someone enters the website, this bit of script which would detect the regional settings - and direct the user to the appropriate site.

I.e User has UK set on regional settings, enters site, script is executed on index page, all currencies are displayed in GBP.

I.e User has US set on regional settings, enters site, script is executed on index page, all currencies are displayed in USD.

Is this possible?

If anyone has any suggestions or ideas to help with the above please let me know.

Thanks in advance
Sarah

mordred
03-03-2003, 04:19 PM
The language can be taken from $_SERVER['HTTP_ACCEPT_LANGUAGE'], maybe also from $_SERVER['HTTP_USER_AGENT']. Put that through a switch statement to initialize the settings for your user's visit.

But: These HTTP headers are not required to be sent by the client. That means that you can't rely on these variables in every situation, client settings or proxies might filter them out. Additionally, user's might use a client with different language settings than the rest of their OS.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum