Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://368249]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2023-12-11 22:44 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (41 votes). Check out past polls.