C and S Design.
Search Friendly Programming and Design

Go to -> C and S Design -> Articles -> Code -> ASP -> Redirect Affiliate Links -> Using PHP -> Show Code

Click here to view or download the code for this example



ASP Code Articles

Redirecting (Masking) Affiliate Links

The PHP version

Amazon with a wide range of products, Ebay have a system called Auction Ads which will show relevant auctions links on your pages, Clickbank ( «« that's a referral link) which has a extensive list of digital products available and Commission Junction

PHP Redirection or Misdirection?

The Code

Click to see the ASP Code Version and read the article on Redirecting (Masking) Affiliate Links

<?php
$destname = strtolower($_GET['name'])

$Dests = array(
"crams"=>"http://www.cram-system.com",
"amazon"=>"http://www.amazon.co.uk",

"ebay"=>"http://www.ebay.co.uk",

"clickbank"=>"http://57erd.reseller.hop.clickbank.net",
"auctads"=>"http://www.auctionads.com/",
"cj"=>"http://www.cj.com/",
"yahoo"=>"http://www.yahoo.com/",
"goog"=>"http://www.google.com/",
"msn"=>"http://www.msn.com/"
)

// Code can be inserted in here to log the clickthrough into a database


header('HTTP/1.1 301 Moved Permanently');
// comment out the line above to send the default 302 redirect;

header('Location: ' . $Dests[$destname]);

// Send the user off to the affiliate page

?>

Click to see the ASP Code Version and read the article on Redirecting (Masking) Affiliate Links


Valid HTML 4.01! Valid CSS! copyright © C and S Design 2004 - 2005
Website Design and SE Friendly Coding C and S Design