spacer
Web Development Tutorials PHP Tutorials
 Developer Newsletter

Tutorials
AJAX
ASP
CGI & Perl
CSS
Flash
HTML
Illustrator
Java
JavaScript
Linux
MySQL
PHP
Photoshop
Python
Wireless
XML
Miscellaneous


Scripts Directory
AJAX Scripts
ASP Scripts
ASP.NET Scripts
CGI & Perl Scripts
Flash Scripts
Java Scripts
JavaScript Scripts
PHP Scripts
Python Scripts
Remotely Hosted Scripts
Tools & Utilities Scripts
XML Scripts

Web Hosting Directory
ASP.NET
Budget
Dedicated Servers
Ecommerce
Linux
Resellers
Shared
Small Business
Windows

Developer Manuals
Learn HTML
Learn PHP
Learn CSS
Learn AJAX
Learn JavaScript
Learn Pear
Free White Papers

Developer Resources
Developer Tools
Developer Content
Survey Software
Dedicated Servers




Effective Geotargeting with PHP

By Akash Mehta
2008-01-27


Getting started

The database is the key to all our GeoIP work — the better the database, the more accurate the country check. The free database from MaxMind offers “Over 98%” accuracy, which is pretty good, but a 2% failure rate can be a little high for businesses. We'll stick to the free version for the moment; you can grab a copy here — you'll need the “latest GeoLite Country Binary Format” version. You'll also need to get their PHP library here. Finally, download and install the PEAR package, Net_GeoIP — you can do this via command line or grab the package file here. Access to a PHP webserver is assumed. Of course, there's no need to try out these samples; the code is pretty light-weight so you can follow along without testing it out.

Incidentally, if you want to write your own lookup system, a CSV version of the actual IP database is available that is very easy to work with when imported into a SQL database. Bear in mind, however, that the database is very large, and another lookup to a database table for every single user can cause significant server load.



Tutorial Pages:
» Introduction
» IP Targeting: It’s tricky business!
» Getting started
» Let's write some code!
» Tips and tricks
» Going further


Related Tutorials:
» Web Database Access from Desktop Applications
» CubeCart 3.0 Installation and Configuration
» PHP Site Search Made Easy
» Installing and Configuring Drupal 6.1
» Desktop Application Development with PHP-GTK
» Installing PHP on Windows



About the NetVisits, Inc Network | Write For Us | Advertise
Copyright ©2007 NetVisits, Inc Network. All Rights Reserved. Privacy Policy.
Visit other NetVisits, Inc. sites: