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

Re: How to check the origin ofi a visitor?

by Seumas (Curate)
on Jun 20, 2004 at 06:41 UTC ( #368249=note: print w/replies, xml ) Need Help??

in reply to How to check the origin ofi a visitor?

No, there's no $ENV{} type of variable you can use for this. You can, however, do a reverse DNS lookup on their connecting IP and see what their TLD is, matching this against a list of ISO country abbreviations. This won't help you with .com, .net, .edu or .org of course.

You can never be completely accurate since all you can verify is the region the IP address is registered in and the person themselves could be anywhere in the world.

Your best bet would be to follow some of the other suggestions in this thread and using the mentioned CPAN packages. You could also take a look at decent web log analysis packages and see how they do it.

It might be interesting to know exactly why you need to know this. If this is for user accounts, it will be useless since there is absolutely no reason your mailing address or residence would be in the same country as your IP address.
  • Comment on Re: How to check the origin ofi a visitor?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://368249]
[Corion]: Meh. My lack of embedded Pg is showing. I can get the data for an image gallery with one SQL statement, but not with SQLite as it doesn't do window functions :-(

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2018-03-23 17:47 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (295 votes). Check out past polls.