With this simple script it’s possible to count and track (country code and IP address) clicks from a visitors which followed a link to one of your link partners or advertisers. This script can be used together with your existing link database or, if you have made some modifications, with an array of links. I used the IP2nation database to get the visitors country code to store this code with the other information. We use the server variable HTTP_REFERER to store the URL, where the link was clicked, with the other data. You can use this script to cloak affiliate links too.

Use these SQL statements within your MySQL client:

Install in the same way the data from ip2nation tables

The PHP code snippet

Create a script past this code between the PHP tags.

How-to use the script in your web page?

The script above is your link target, you need to create links like: