Need to get IP geographic location!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rustamabd
Forum Newbie
Posts: 2
Joined: Thu May 19, 2005 10:38 am

Need to get IP geographic location!

Post by rustamabd »

Is there a PHP package for this? I need to be able to query arin and ripe from a PHP page.
TIA
- Russ -
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

one preferably without the user of pear please :)

seriously, i can think of a 1001 reasons i would use this
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

Post by phpScott »

don't know how it works as I haven't checked it out yet but I remebered this thread so I though I would post the link
http://www.phpbuilder.com/snippet/detai ... pet&id=291
rustamabd
Forum Newbie
Posts: 2
Joined: Thu May 19, 2005 10:38 am

Post by rustamabd »

I could just parse the whois results from ARIN and RIPE in my php page...
Does anyone know if there are any flood limitations on whois.arin.net and whois.ripe.net?
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

http://www.maxmind.com/app/php

Try the Pure PHP version.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

Last time I looked I was sitting in my office on the south coast of the UK, but now I'm in the sea just to the west of Africa.

Strange.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

I know, it's time i update my geoip.dat file :)
And the positioning on the map may need some tweaking too.


They are already on my TO-DO list..
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

man, that looks sweet!
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

indeed, that is very nice I've only ever used this one:

http://www.antionline.com/tools-and-toys/ip-locate/

and I've always wondered how it was done, do you just have a db with a set of ips Tim?
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

antionline returned for my IP
xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx) is located in Milton, New South Wales (state), Australia.
when it should have returned India !

1. Get the contents of http://whois.sc/xxx.xxx.xxx.xxxx and parse the data.
2. http://www.phpclasses.org/browse/package/2099.html - Works but need to make changes - I guess that was meant for an older version of PHP 5 ?
3. http://www.e-riding.com/whereisthatip/ - small SOAP API (PHP5)
4. http://ip-to-country.webhosting.info/ - You have to keep updating the db every month
5. http://www.phptricks.com/?lesson_id=23&section=2 - Dont know abt this.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

I got a copy once of http://www.maxmind.com/app/city because i was doing a localized banner scripts.. (But i've noticed that if you google for GeoIPCity.dat you might be able to find a "free" version :p)
Post Reply