Cloaking your affiliate links is so easy
Posted 11th February 2009 at 07:24 AM by Joe721
I was reading some blog article discussing all this about embedding cloaked links and affiliate links the other day and realized that most people just don't realize how simple this is. Also, the way shown here avoids what I think are messy looking shorturls, or crude methods using simplistic JavaScript to modify what the status bar says.
Maybe in the future I'll extend it to use a nice little web-interface where the actual and displayed URL's can be entered, but for now I show the basic thing. When I wrote it I wasn't concerned about hiding affiliate links, I just needed a way of simplifying and organizing the linking to various examples I have available.
All that is assumed is ftp to a php enabled server, and ability to edit text. If you know php, the following is simple, if not, just use it as is anyway.
1. Copy the following block of code into a plain text editor and save it as something like getmylink.php:
2. Fill it out with your affiliate (or whatever) url’s replacing my example
etc
3. Extend to as many url’s as you want by just repeating this little code block:
4. Upload to your server, lets assume to your “scripts” folder
5. Here’s how you use it in the page:
etc.
Maybe in the future I'll extend it to use a nice little web-interface where the actual and displayed URL's can be entered, but for now I show the basic thing. When I wrote it I wasn't concerned about hiding affiliate links, I just needed a way of simplifying and organizing the linking to various examples I have available.
All that is assumed is ftp to a php enabled server, and ability to edit text. If you know php, the following is simple, if not, just use it as is anyway.
1. Copy the following block of code into a plain text editor and save it as something like getmylink.php:
PHP Code:
<?php
if(isset($_GET['lid'])){
$lid = $_GET['lid'];
}else exit();
$link;
if($lid){
switch ($lid){
case "001":
$link=’http://www.myfirstURL.com/’;
break;
case "002":
$link=’http://www.mysecondURL.com/’;
break;
case "003":
$link=’http://www.mythirdURL.com’;
break;
default:
$link=”;
exit();
}
header(”Location: $link”);
exit();
}
?> 2. Fill it out with your affiliate (or whatever) url’s replacing my example
PHP Code:
$link=’http://www.myfirstURL.com/’;
3. Extend to as many url’s as you want by just repeating this little code block:
PHP Code:
case "004":
$link=’http://www.myfourthURL.com’;
break;
4. Upload to your server, lets assume to your “scripts” folder
5. Here’s how you use it in the page:
HTML Code:
<a href="scripts/getmylink.php?lid=001" target="_blank">my cloaked affiliate link1</a> <a href="scripts/getmylink.php?lid=002" target="_blank">my cloaked affiliate link2</a>
Total Comments 0

