网络实验室

 找回密码
 注册账户
查看: 3047|回复: 3

Clickbank Redirect Script (PHP)

[复制链接]
无心的棋子 发表于 2008-8-6 20:02:02 | 显示全部楼层 |阅读模式
As always trying to use search engine marketing and optimization (SEM&O) in the best possible way, I try to combine them so they both workout perfectly.

Without delaying, here is the script that will create redirects for ClickBank (if you notice errors or want improvement, you can drop a comment):
    <?php

    // ClickBank Redirect/Cloak Script (PHP)

    // example, relative URL: cb.php?s=STORE-ID

    // made at http://ugux.com/blog/

    $nickname  =  ‘multiz’; //your ID/nickname is at clickbank

    $store     =  $_REQUEST[’s’];

    $extra     =  $_REQUEST[’x'];

    $tid       =  $_REQUEST[’tid’];

    if($tid)

    {

    $extra .= ‘&tid=’.$tid;

    }

    if($store)

    {

    header(’Location: http://’.$nickname.’.’.store.’.hop.clickbank.net/?’.$extra);

    }

    else

    {

    //if something is entered wrong, they’re sent to your not found (404) page

    // or whatever page you choose.

    header(’Location: 404.shtml’);

    }

    ?>


For those of you who do not like reading useless instructions, a link would look like this:

    <a href=”/cb.php?s=store” rel=”nofollow” title=”Add an SEO friendly persuasion to the reader/buyer”>Store</a>

How to use the script

1. Save the script as cb.php or something else and upload it

2. Change the line: $nickname  =  ‘multiz’; to $nickname  =  ‘YourClickbankNickname’;

3. Link to merchant or store using their Clickbank ID (usually found as the subdomain after your Nickname; http://yourNickname.storeID.hop.clickbank.net)

4. Link like this cb.php?s=STORE-ID (although obvious, make sure you change STORE-ID; you have no idea how many people will mess this up)
Advanced parameters

1. You can add tracking IDs by linking like this: cb.php?s=STORE-ID&tid=TRACKING-ID

2. Add any extra parameters: cb.php?s=STORE-ID&x=MORE-Parameters

For more parameters, you will need to URL-encode any extra “=” or “&”.
Other tips (SEO & SEM)

1. Change robots.txt by adding Disallow: /cb.php to a new line

2. Add title attributes to links (can increase conversions and provide a little better SEO) <a href=”/cb.php?s=store” title=”A store that adds insane discounts daily”>Store</a>

3. Keep your pagerank by adding rel=”nofollow” to links <a href=”/cb.php?s=store” rel=”nofollow” title=”A store that adds insane discounts daily”>Store</a>

FYI: This should be able to prevent sneaky Adware that tries to place their ClickBank ID in your ClickBank links.
Another PHP Clickbank script

Another Clickbank script should be added soon that will automatically fetch merchants/products based upon added keywords.
麻雀 发表于 2008-8-6 21:36:13 | 显示全部楼层
哦,这东西很多人需要呢!谢了!
jilimin123 发表于 2008-8-10 11:15:49 | 显示全部楼层
不知道怎么设置
judith912 发表于 2008-8-12 15:19:37 | 显示全部楼层
这个东西是干吗的啊?不懂呀
您需要登录后才可以回帖 登录 | 注册账户

本版积分规则

黑屋|存档|手机|网络实验室 本站服务器由美国合租以及IDCLayer国际数据提供!!!

GMT+8, 2024-5-5 20:58 , Processed in 0.060818 second(s), 10 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表