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


Going further

We aren't limited by country codes, of course — if you take a look through the documentation for the PEAR package, you'll find methods for country name, region and even organization / ISP! Experiment with multiple versions of your website content in a format that you can easily work with; if you have a content management system, you may be able to build a feature to create pages for users from a particular country. If you're looking for slightly more accurate lookups, MaxMind also offers city databases that complement the country database we worked with in this tutorial, and they have paid versions of both that offer somewhat better accuracy. Be creative and have fun guiding your users to a new world, where the information knows just a little more about them.

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

Recent Comments
Draicone
February 24, 2008, 1:51 am

[quote=ryanhellyer;3306]That's a really useful thing to know, as I often assume basic, small scripts like that won't suck up too much resources, but obviously this is not the case here.[/quote]

It's interesting looking through execution times for different scripts and servers. The length of the script isn't so much important as the complexity.

For example, there are some very bloated CMSs out there that take 10 seconds to generate a page, whereas a simple CMS like SilverStripe takes 0.01 seconds. Still, SilverStripe has a lot of code powering it, especially a lot of HTML.

This script isn't as small as it seems though - I don't show you the massive IP database that comes with it ;) It has thousands of records that this small script sifts through to match the location of the current user.

duellevel
February 19, 2008, 10:43 am

Good tutorial, thanks [URL="http://forums.developertutorials.com/members/draicone.html"]Draicone[/URL] :)

ryanhellyer
February 18, 2008, 4:09 am

Thanks Akash.

Your tutorial covers everything quite well though, so I should be able to nut it out quite easily.


I find the following quite fascinating ...
[quote]script takes on average 0.05 seconds to execute .... an entire script to generate a database-driven page takes 0.01 seconds on the same server.[/quote]
That's a really useful thing to know, as I often assume basic, small scripts like that won't suck up too much resources, but obviously this is not the case here.

Read all comments



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