My script for cloaking and geotargetting

Status
Not open for further replies.

CygnusX

New member
Mar 4, 2007
744
14
0
Belgium
Here's a custom made script that I use when direct linking to offers. Besides the cloaking, it also allows geotargetting.

For example... Say you install it on www.yourdomain.com and want to link to Google. You can make 1 link (www.yourdomain.com/google) that redirects to www.google.de for German visitors, www.google.ca for Canadian visitors and www.google.com for all the rest.

You can download the script here: http://www.mediafire.com/?dmgwo3vvmya

Requirements:
- PHP and MySQL
- GeoLite Country by MaxMind, a free geotargetting database
- A host that supports .htaccess and mod_rewrite (most do)
- A domain

Installation instructions:
- Download the .rar file and upload to your server.
- Make a /log folder on your server and chmod it to 777 so that log files can be written in that folder.
- Install GeoLite Country.
- Update index.php with your MySQL server info (search for 'mysql_connect').

Usage instructions:
- Open links.txt
- For every country and for every keyword, add a new line that looks like:
COUNTRYCODE;KEYWORD;LINK
To match all countries, use the '*' wildcard. Keep in mind that the script will stop when it finds a matching line, so wildcard should be added after all other rules.
- Save links.txt

The links.txt code for the example given earlier in this post looks like this:
Code:
CA;google;[URL]http://www.google.ca[/URL]
DE;google;[URL]http://www.google.de[/URL]
*;google;[URL]http://www.google.com[/URL]
If you have any questions or problems, please let me know. If you want a more user friendly admin panel, pm me and I can write one for you (but not for free :D).
 
  • Like
Reactions: guerilla


Thanks for the script, it looks awesome. I probably wont use it anytime soon, but its good for me as a learning programmer to see whats going on and figure out new stuff.

its awesome when its free and open source so I can pull what I want from it.

Thanks!
 
I don't know too much about mysql, do I need to have much knowledge to install the GeoLite database? Do I want the Binary or CSV version? Once I have the IP database correctly on my server I'm sure I can figure out how to use your script. This will be so useful, I can't wait to get it working! Thanks for sharing this :)
 
I don't know too much about mysql, do I need to have much knowledge to install the GeoLite database? Do I want the Binary or CSV version? Once I have the IP database correctly on my server I'm sure I can figure out how to use your script. This will be so useful, I can't wait to get it working! Thanks for sharing this :)

Sorry, I accidently missed some details in my first post. You'll need this information to install the GeoLite database:
HOW-TO Import the MaxMind GeoIP Free Country CSV file into MySQL and save diskspace

If you can't run mysqlimport on your server, you can also import it using PhpMyAdmin. That's how I did it on my server.
 
Status
Not open for further replies.