Go Back   WarriorForum - Internet Marketing Forums > The Warrior Forum > Main Internet Marketing Discussion Forum
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 04-17-2009, 11:14 PM   #1
makemoney
War Room Member
 
metafever's Avatar
 
Join Date: Mar 2009
Location: The Internet
Posts: 581
Thanks: 40
Thanked 101 Times in 28 Posts
Social Networking View Member's Twitter Profile  View Member's YouTube Profile
Contact Info
Send a message via AIM to metafever Send a message via Yahoo to metafever Send a message via Skype™ to metafever
Default PHP Link Cloaking Code

Here is some PHP code that might be of use.

Copy and paste this code into a notepad file, then name it index.php.

Create a folder . . . something like "jump".

So then you would have a link like: http://www.yourURL.com/jump/?at=boom

This is a true affiliate cloaking script and not a work around (this will stop any link hijacking).

You can obviously replace boom for "affID1" or something more relevant to you.

You can also change the affiliate link URL for any offer you are sending traffic to. I just included a Clickbank URL for grins and giggles.

------------------------------------------------------------------

<?php

if ( empty( $_GET['at'] ) ){
// this is the default affiliate link if no destination is specified
$link = "http://affiliateID.vendorID.hop.clickbank.net/";

}else{
if ( $_GET['at'] == 'boom' ){
$link = "http://affiliateID.vendorID.hop.clickbank.net/";
}
}

header('Location: ' . $link );

?>

------------------------------------------------------------------

Visit My Blog - MetaFever.com
metafever is offline   Reply With Quote
Old 04-18-2009, 12:48 AM   #2
Music is my Life
War Room Member
 
Join Date: Mar 2009
Posts: 286
Blog Entries: 3
Thanks: 16
Thanked 14 Times in 14 Posts
Default Re: PHP Link Cloaking Code

Thank you if really helps a lot. Nice PHP Linking Code. Keep it up.
reynald2790 is offline   Reply With Quote
Old 04-18-2009, 02:19 AM   #3
Rumormill Marketing
 
Andrew E.'s Avatar
 
Join Date: Dec 2008
Location: Compton, CA
Posts: 76
Thanks: 0
Thanked 9 Times in 7 Posts
Social Networking View Member's Twitter Profile 
Contact Info
Send a message via MSN to Andrew E.
Default Re: PHP Link Cloaking Code

Here is a quick improvement to the code I just whipped up.

PHP Code:
    //enter any number of links and trigger codes here.
    
$linksArray = array(
    
'http://www.AffLink1.com' => 'Pop1',
    
'http://www.AffLink2.com' => 'Pop2',
    
'http://www.AddLink3.com' => 'Pop3' //NOTE - No ending comma on the last link
    
);
    
    
$defaultSite 'http://www.DefaultSite.com'//Default site to go to in case no 'at name' is triggered, or an 'at name' is not passed.

    
if (isset($_GET['link']) && in_array($_GET['link'], $linksArray)):
        
header('Location: '.array_search($_GET['link'], $linksArray));
    else:
        
header('Location: '.$defaultSite);
    endif; 
Here is how you use it:
  1. Enter a list of URL's you want to redirect to, and a trigger code for each of the URL's you entered like I did above. Make sure there is no comma at the end of the last site-trigger combination of your list (this is very important)
  2. Enter a default URL to go to in case you don't hit a trigger code, or simply don't pass one.
  3. Copy the code, paste it in an editor somewhere, change it to your needs, call it whatever.php. Upload.
  4. When you want to use it, use it in a link like this:
    whatever.php?link=triggerHere
Feel free to use and adapt this code to any use, so long as you don't resell it as your own, or include it in any commercial package or distribution.
Andrew E. is offline   Reply With Quote
Old 04-18-2009, 04:31 AM   #4
Don't Just Sit There!
 
pjCheviot's Avatar
 
Join Date: Jan 2009
Location: NE UK
Posts: 748
Thanks: 498
Thanked 231 Times in 208 Posts
Social Networking View Member's Twitter Profile  View Member's YouTube Profile
Default Re: PHP Link Cloaking Code

These aren't "cloaking" codes in the true sense of it - they are redirect codes.

When used, these codes still eventually show your affiliate link in the browser address bar and aren't really "cloaked"

They do obviously work for redirecting links though.

Just my thoughts . . .


"I started out with nothing and I've still got most of it left!"

Fellow Warrior KimW needs our help

pjCheviot is offline   Reply With Quote
Old 04-18-2009, 04:42 AM   #5
Rumormill Marketing
 
Andrew E.'s Avatar
 
Join Date: Dec 2008
Location: Compton, CA
Posts: 76
Thanks: 0
Thanked 9 Times in 7 Posts
Social Networking View Member's Twitter Profile 
Contact Info
Send a message via MSN to Andrew E.
Default Re: PHP Link Cloaking Code

Quote:
Originally Posted by pjCheviot View Post
These aren't "cloaking" codes in the true sense of it - they are redirect codes.

When used, these codes still eventually show your affiliate link in the browser address bar and aren't really "cloaked"

They do obviously work for redirecting links though.

Just my thoughts . . .
You're quite right.

If you wanted to make a true cloak, you can just take the url and chuck it into a frame, like most other affiliate link cloakers do.
Andrew E. is offline   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > The Warrior Forum > Main Internet Marketing Discussion Forum

Tags
cloaking, code, link, php

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 11:25 PM.