How to Use a PHP Jump Script for Affiliate Links

How to Use a PHP Jump Script for Affiliate Links

A typical affiliate link is full of random letters and numbers, and depending on the affiliate system, even the domain name itself may appear to be nothing but a random combination of characters. When one of your readers hovers the mouse pointer over the affiliate link, they can see the full text of the link, and could be scared away. Some people might even copy the link, and paste it into the address bar, removing the affiliate code. If your writing generates a sale through one of your affiliate partners, you deserve to receive credit for that sale. By using a PHP jump script for affiliate links, you can help to prevent these scenarios from occurring.

Credit where it is due: You may download the PHP Affiliate Jump Script from the website of Steve Dawson, the original designer. Unzip the script and open it in a text editor such as Notepad. PHP Affiliate Link Script (Opens in a new window)

This is the first line of the PHP jump script that we will modify:

if ($m == “”) {$link = “”;} // Default Blank

Change it so that the link points to the main page of your website. This way, if someone attempts to load the PHP jump script directly, they will be redirected to the main page of your site.

Next, modify the second line:

if ($m == “Just Phones”) {$link = “”;}

Replace the first section in quotation marks, “Just Phones,” with the “shortcode” that you would like to use to identify your affiliate link. For example, let’s say that you wanted to create a link to Adobe Photoshop Elements, a product that recommend and will write about in the future, at Make a shortcode that makes it obvious where the link will take the reader, such as “PhotoshopElements.” Place the full link, what your affiliate tag, in the second group of quotation marks. For example, if I were to make a link to Photoshop Elements on using my affiliate tag, the completed line would look like this:

if ($m == “PhotoshopElements”) {$link = “”;}

Continue adding additional affiliate links to the PHP jump script by copying and pasting this line and modifying it, or simply adding more lines like this to the end of the script:

if ($m == “”) {$link = “”;}

Remove any incomplete lines from the PHP jump script when you are finished, and save the file. Upload it to the main directory of your website (usually the “public_html” directory). You can simply add new lines to the jump script and re-save it later as you add additional affiliate links.

Now, use the PHP jump script on your website by creating a link like so, substituting the URL and shortcode for those of your website and affiliate link:

When the link is complete, it will look like this:

Adobe Photoshop Elements 9 (

You may, of course, use any text that you like for the link.

Comments are closed.