Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Finding out which country a user comes from using $_ENV[HTTP_...]

by grantm (Parson)
on Oct 09, 2002 at 23:45 UTC ( [id://204067]=note: print w/replies, xml ) Need Help??


in reply to Finding out which country a user comes from using $_ENV[HTTP_...]

Apache has a setting called: 'HostnameLookups' which defaults to 'Off'. If you change this to 'On', then you can get the fully qualified domain name of the client rather than it's IP address from the environment. Don't do this. This will slow down all requests to your server and increase the load. It will not be able to resolve addresses for which there is no reverse lookup. There is no guarantee that the domain name will bear any resemblance to the country the user is in anyway (ISPs the world over use .net addresses for example).

You could also look at the Accept-language header to get some clue but that's not likely to be much more successful (but at least the overhead will be lower).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://204067]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-03-29 07:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found