--- Filip de Waard <[EMAIL PROTECTED]> wrote:Using HTTP headers to identify the country where a visitor comes from is totally inaccurate.
That's not really very fair to HTTP. There is no header that identifies the country, so it's not inaccurate - it doesn't exist. :-)
Trying to accurately determine a country from a language isn't the fault
of HTTP. I'm sure this is what you were implying, but I wanted to make
sure HTTP wasn't being blamed.
Chris
Hey Chris,
I'm not blaming HTTP, but browsers and operating systems that implement it. I posted the HTTP header that my own browser is using to identify it's language as an example to prove that Accept-Language isn't the right source to identify the visitors language or even his home country. I know there is no such thing as a 'Country' header in HTTP, but even Accept-Language is quite inaccurate.
I can't back this by scientific evidence, but I'm pretty sure that using IP addresses to figure out in which country the visitor is located in combination with a table containing the main languages for that country is far more accurate then using the Accept-Language as a source to identify the users language. One of the mantra's of web development that I've encountered is: "Never trust HTTP headers as a valid data source". Please don't read that as an attack on HTTP itself...
Using IP addresses to identify the visitors language has three major downsides: a. it's not 100% accurate (but nothing is), b. some countries have multiple main languages (like Canada) and c. querying databases for IP addresses takes a performance toll. IP addresses are just giving a hand, but they are no heavenly cure for all our problems. Personally I'm using IP addresses nevertheless, since I'm convinced that it's the best way to initially identify the visitors language or country.
I don't have any experience with GeoIP Country from Maxmind (I'm using ip-to-country), but will try it out soon. Thank you for the tip!
Regards,
Filip de Waard
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php