lunny Posted April 28, 2007 Share Posted April 28, 2007 Hi guys, My query is as follows i have IP address stored in variable and would like to know how to find out the location of the IP address. And how close can i actually get as in Country/City/.. Thanks Quote Link to comment Share on other sites More sharing options...
ignace Posted April 28, 2007 Share Posted April 28, 2007 Using an ip is never very accurate when it comes to determing the users exact location. The mechanism works as follows (in case you wish to implement it): a new ip address is found and a user is requested, to type in his location, this can easily be done through registration (or whenever a user logs in, and his current ip does not match his previous), however most ISP's provide a dynamic ip address to their clients, so you see that the accuracy of the mechanism decreases GeoIP for example contains about a few million addresses, and is more accurate then most systems, however you need to obtain a site license to use their software. Quote Link to comment Share on other sites More sharing options...
lunny Posted April 28, 2007 Author Share Posted April 28, 2007 Ok maybe I should explain why I want to do this first, .... Im working a program to catch 'email snoopers', so we create a honeypot link, snooper visits link and we gather their IP address. Now i just need a location, so as u can i cant really ask for their location in the registration Quote Link to comment Share on other sites More sharing options...
taith Posted April 28, 2007 Share Posted April 28, 2007 i have a way of finding out which country their from by ip...? that any use? email me if ya want it... Quote Link to comment Share on other sites More sharing options...
ignace Posted April 28, 2007 Share Posted April 28, 2007 So, a snooper visits a link, you gather it, you get his location, and then what? You ban the ip address? And what if they are working on a dynamic ip address (what they probably are)? Or do you wanna ban a complete pool (e.g.: texas)? Quote Link to comment Share on other sites More sharing options...
lunny Posted April 28, 2007 Author Share Posted April 28, 2007 lol not ban at just give the person who wishes to catch a snooper with a location where the snooper is from Quote Link to comment Share on other sites More sharing options...
taith Posted April 28, 2007 Share Posted April 28, 2007 if you just drop the ip address into a dns server(www.dnsstuff.com) for example, it'll tell you everything you want/need to know... Quote Link to comment Share on other sites More sharing options...
ignace Posted April 28, 2007 Share Posted April 28, 2007 well, as i mentioned before, GeoIP is the most accurate, they have an open-source version, check it out: http://www.maxmind.com/ @taith not exactly, that is only possible when they have been using a static ip address, if it is dynamic, it will be pointing you to a wrong location! Quote Link to comment Share on other sites More sharing options...
taith Posted April 28, 2007 Share Posted April 28, 2007 the ip's come dynamically from the ISP, however they hold right to them... they all do have an area attached to them... which... indeed isnt infalable... but it would give you the area it comes from, the ISP name, security information, phone numbers, etc... Quote Link to comment Share on other sites More sharing options...
lunny Posted April 28, 2007 Author Share Posted April 28, 2007 taith your email seems to be hidden.. Thanks for all the help by the way guys Quote Link to comment Share on other sites More sharing options...
lunny Posted April 30, 2007 Author Share Posted April 30, 2007 The problem with the links specified (Which is what im looking for), is that I would have to send anyone using my application to this site. What I would ideally want is to report results from my page. I know I can't get as specific as the above site, but even retrieving just Country/City with PHP code is it possible ? Quote Link to comment Share on other sites More sharing options...
map200uk Posted April 30, 2007 Share Posted April 30, 2007 well if you resolved the hostname then explode it and take the tld and compare it you could get the country i.e. user-1-test.nl if you exploded that then compare the extension (.nl) to a list of extensions, stored in an array you would see its Netherlands, a list of tlds is out there, and this would tell country-but not the area of the country-altho as mentioned before most arent very accurate when it gets to area of the country map Quote Link to comment Share on other sites More sharing options...
rochakchauhan Posted August 16, 2008 Share Posted August 16, 2008 To get country from IP address for FREE... try API from http://geoip.dmwtechnologies.com Quote Link to comment Share on other sites More sharing options...
coder500 Posted August 16, 2008 Share Posted August 16, 2008 If you want a free PHP script you will get it here http://www.hotscripts.com/Detailed/54660.html Quote Link to comment Share on other sites More sharing options...
coder500 Posted August 16, 2008 Share Posted August 16, 2008 Just came across a tutorial on this. I haven't tried it, but it seems it will work and will be helpful for u. http://www.ip2location.com/faqs-ip-country.aspx What it does is converting an ipaddress to ipnumber. Then it searches a database using that ipnumber to find out the location. It seems the database is free. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.