Have you ever wanted to hide the link in your web page or blog that is actually an affiliate link? Many people pay attention to links before they click to see where they are going next or some people are put off by ugly affiliate links.
Also, you don’t want to bleed the Google PR (Page Rank) to your affiliates website. To get around this, you can quickly and easily implement this script to hide your affiliate links and make your links more inviting and cleaner. First of all, this is a PHP script that should work on all main stream web hosts.
If you have never done any programming before, don’t worry, we won’t try and turn you into a geek, this is basically a Copy-Paste deal and we have even attached the final file at the end of this article for you to download. First of all, here is the code:
// Easy Link cloaker - The Manic Marketer
$id = $_GET['id'];
$links = array(
// Add your links here…
“themanicmarketer” => “http://www.imsuccesscenter.com”,
“google” => “http://www.google.com”,
“yahoo” => “http://www.yahoo.com”,
All you have to do is copy and paste this code into a text document using Notepad or some other text editing program and save the file as “recommends.php” then modify it to add your affiliate links.
How Does This Actually Work?
Well, what we have here is a phrase that is a friendly identifier that when sent to the script it matches it up to a link that we wish to hide. Let’s take one of the examples in this script:
"themanicmarketer" => "http://www.imsuccesscenter.com", As you can see here, the phrase “themanicmarketer” is matched to “http://www.imsuccesscenter.com” so the following link that you would use in you actual web page:
http://www.yourdomain.com/recommends.php?id=themanicmarketer Would send the customer to http://www.imsuccesscenter.com.
How Do I Customize the Links?
All you have to do is edit the script in Notepad and add a new row to the list of links. Just add you links under the “Add you links here” section and use the format shown below:
"yourphrase" => "http://www.youraffiliatelink.com?affiliateid=youraffiliateid", Obviously you would swap the phrase and link to suit your needs.
Ok, I Have Customized the File and Added My Links. Now What?
Just upload it to your website and test it using this link format. If it work’s, you are good to go, you are ready rock.
http://www.yourdomain.com/recommends.php?id=<YOUR PHRASE> Remember, you can call this file what ever you like such as “goto.php” or “r.php”, etc. Choose what ever you like and what ever suits your needs. In the advanced section we have an advanced version of this script that counts links and creates a much friendlier link format such as http://www.yourdomain.com/recommends/yourphrase. If you are feeling adventurous and need a little extra functionality, head on over to the advanced section and take a look. Also, as mentioned, we have attached a completed version ready for your customization below to save you some time.