Home Home  

Project: IP number to country

This project allows you to retrieve the country of the visitor using the IP number of the visitor.

Very handy when you are developing a internationalized application. The ISO code, in lowercase, can be used to set the interface language.

By passing the IP number to a function, you'll get the following information:

  • ISO 3166 Code, 2 characters, might be used to set the culture
  • Country, 20 characters

Techniques used: PHP5, MySQL (although any sort of database might be used).

The project will become available as a symfony Plugin (Open Source). It's already made available by me in the form of a symfony snippet and can be found over here.

The IP data is imported from the webnet77 database, probably the most frequently update database on the web, which is weekly downloaded using CRON to the webserver.

See example below:

Your hostname:38.107.179.209
Your IP number:38.107.179.209
Your IP numerical:644592593
Data retrieved from IP database:
ISO code:USYour flag
Country:UNITED STATES
Updated at: 2008-03-14

Search

 
 


Popular Tags



Info

About this site
Copyright
Contact
Sitemap


User options

Change font size (Help)


User friendly printing (Help)

 


Valid XHTML 1.0 Transitional