Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2014-11-28 00:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (190 votes), past polls