I wish to be able to tell from what country my visitors are from. I know it's somewhere in the system variables, but where.. that I don't know. Do you?
There is no accurate way to get the user's country.Since Joe Bloke in UK can have the same value as Billy Bob in the US (believe me, I have seen it where both were en-us). Even countries that don't have English as a major language, such as France, still have a people who have their servers or the servers from which they connect from are set to English since that is most likely where the system was built.
In any case, there is absolutely no sure way of getting the country which the user is from.
In any case, HTTP_ACCEPT_LANGUAGE AND even some fancy footwork on REMOTE_ADDR can get you at least guessing.
(by the way, you would have to do some lookups on REMOTE_ADDR to its country location to get something useable).
HTTP_ACCEPT_LANGUAGE is the browser language not server.
If you have IE, go to:
Tools->Internet Options->Languages
If you change this value, then the server should pick it up under HTTP_ACCEPT_LANGUAGE.
Therefore a look at this server variable will tell you what the browser language and country is set to. Ofcourse the user might have not set this correctly. So you cant rely on it.
It is understood that this is a client setting....and it is also true that there is absolutely nothing that can be relied upon without a large margin of error (can you say, 'Greater than 50%'?) :-0.
No fool-proof way of doing it, but traffic analysis software parses the domain of the referrer. If it ends in .ru then it is a russian domain, .jp is japanese, etc. You might try that approach.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.