Home arrow PHP arrow Building Sample Programs for an IP-to-country Mapping Application

Building Sample Programs for an IP-to-country Mapping Application

Undeniably, the ability to determine from which countries visitors are accessing a particular web site can be useful, and not only for statistical purposes. With this information at your disposal, it’s possible to instruct the site to deliver its content in different languages, a feature that users worldwide will appreciate. This second part of a four-part series moves you in that direction with some sample programs.

TABLE OF CONTENTS:
  1. Building Sample Programs for an IP-to-country Mapping Application
  2. Review: building an IP-to-country mapping MySQL table with a lookup database file
  3. Mapping IP addresses to originating countries with a basic geo location application
  4. Developing an object-oriented geo-location PHP application
By: Alejandro Gervasio
Rating: starstarstarstarstar / 5
February 10, 2009

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Introduction

Building a web site that will be seated on a multi-lingual platform often requires developing an IP-to-country application that permits you to map users' IP addresses to their corresponding countries. Thus, if you're interested in learning how to create an application like this, which can be easily incorporated into any existing web site, then this series of articles might be what you're looking for.

Of course, if you already read the initial chapter of this series, then you're already familiar with creating the basic structure of the aforementioned IP-mapping program. In that tutorial I explained how to create a lookup MySQL table by importing the contents of the IP-to-country database, available for free at Webnet77.

This database contains over 82,0000 records and allows you to map more than 3,200,000 IP addresses to their respective countries. This can be really handy for developing different IP-to-country applications with minor efforts.

Since I already discussed how to create a mapping MySQL table by using the lookup database, in this second article I'm going to appeal to the functionality of this table to build a couple of sample PHP applications. These applications will be capable of determining from which country visitors are accessing a web page, in accordance with their IP addresses.

Now, it's time to get rid of the preliminaries and start developing these simple -- yet efficient -- IP-to-country programs with PHP. Let's jump in!



 
 
>>> More PHP Articles          >>> More By Alejandro Gervasio
 

blog comments powered by Disqus
   

PHP ARTICLES

- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...
- PHP: Building Concrete Validators
- Sanitizing Input with PHP
- Executing Shell Commands with PHP
- Handling File Data with PHP
- File Security and Resources with PHP
- ArrayObject PHP Class Examples
- ArrayObject PHP Class: An Introduction
- Getting File System Data with PHP
- PHP Tools for Working with the File and Oper...
- Working with the File and Operating System w...
- PHP Proxy Patterns: Completing a Blog


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 4 - Follow our Sitemap

Dev Shed Tutorial Topics: