views:

140

answers:

4

Hi all

Is there any possible way to find the name of the country using IP with scripting language PHP ?

Thanks in advance

Fero

+3  A: 

You can use GeoIP for PHP. Here is another site with simpler reading instructions.

garethm
A: 

Read the Friendly Manual at:

http://us3.php.net/manual/en/book.geoip.php

quosoo
+1  A: 

You can use the free and monthly updated IP to Country database.

middus
+4  A: 

Depending on your needs at a budget level and an accuracy level there are a few options:

IPGeo: www.ipgeo.com (Free option)

MaxMind GeoIP:http://www.maxmind.com/ (Free option)

Quova: http://quova.com/ (Paid)

NetAcuity by Digital Element/Envoy: http://www.digital-element.com/ (Paid)

Digital Envoy is the inventor of the IP Intelligence space, has the richest dataset of all the providers, and is considered the industry leader. They offer enterprise level solutions and performance, which may or may not be what you're looking for. If all you're interested in is country level data, then most of these providers should be able to suit your needs (accuracy wise) as finding the country of the IP address is not difficult from a technical standpoint. If your budget is free, then my advice would be to use the data provided by MaxMind.

If down the road, you find yourself in need of more granular geographic data (i.e. city level data), then the accuracy between these providers varies greatly with the upper hand going to MaxMind and Digital Envoy, with Digital Envoy having the best overall solution.

Edit:

In regard to one of the users comments about proxies, this can be an issue. Some networks (such as AOL) route all their data through a proxy. Usually that proxy is located within the same country as the originating connection, so the country level data is as accurate as if the user wasn't using a proxy. Obviously if someone wants to use a proxy outside their country they can, but this is the exception not the rule for general internet traffic. Some providers offer a proxy database, or flag ranges known to be proxies, so that you as the user can choose whether or not to trust it for your purposes.

RC