clickbank 短信提醒代码及设置方法
2010-09-15有人在寻找设置Clickbank产生销售时手机短信提醒的设置方法,很多说测试不成功,onlyqian把代码发我测试了一下,是可以用的。
原理简述:cb产生sale以后,根据自己后台提供的secret key和mail.php,使用mail函数发邮件至指定邮箱,邮箱为139邮箱或qq邮箱绑定手机,即可收到cb产生销售的手机短信提醒。
代码如下:点击下载 (此代码cb后台可获取)
- <?php
- function cbValid() {
- $key='7009';
- $ccustname = $_REQUEST['ccustname'];
- $ccustemail = $_REQUEST['ccustemail'];
- $ccustcc = $_REQUEST['ccustcc'];
- $ccuststate = $_REQUEST['ccuststate'];
- $ctransreceipt = $_REQUEST['ctransreceipt'];
- $cproditem = $_REQUEST['cproditem'];
- $ctransaction = $_REQUEST['ctransaction'];
- $ctransaffiliate = $_REQUEST['ctransaffiliate'];
- $ctranspublisher = $_REQUEST['ctranspublisher'];
- $cprodtype = $_REQUEST['cprodtype'];
- $cprodtitle = $_REQUEST['cprodtitle'];
- $ctranspaymentmethod = $_REQUEST['ctranspaymentmethod'];
- $ctransamount = $_REQUEST['ctransamount'];
- $caffitid = $_REQUEST['caffitid'];
- $cvendthru = $_REQUEST['cvendthru'];
- $cbpop = $_REQUEST['cverify'];
- $xxpop = sha1("$ccustname|$ccustemail|$ccustcc|$ccuststate|$ctransreceipt|$cproditem|$ctransaction|"
- ."$ctransaffiliate|$ctranspublisher|$cprodtype|$cprodtitle|$ctranspaymentmethod"
- ."|$ctransamount|$caffitid|$cvendthru|$key");
- $xxpop=strtoupper(substr($xxpop,0,8));
- if ($cbpop==$xxpop) return 1;
- else return 0;
- }
- if (cbValid())mail("test@9499.com", "ClickBank - " . $_REQUEST['ctransaction'],"Product: " . $_REQUEST['cprodtitle'] . "\nPublisher: " . $_REQUEST['ctranspublisher'] . "\nAffiliate: " . $_REQUEST['ctransaffiliate'] . "\nTransaction: " . $_REQUEST['ctransaction'] . "\nAmount: " . $_REQUEST['ctransamount']);
- ?>
用法:
1、命名以上代码为mail.php,修改mail.php中的Secret Key 改为任意的大写字母或数字,邮箱改为你的邮箱,保存,然后上传到你的空间上。
2、打开CB账号,进入 ACCOUNT SETTINGS - My site – Advanced Tools – Edit
Secret Key: 填上刚才PHP文件中的“任意的大写字母或数字”
Instant Notification URL: 点 (request access)
3、出来一列问题,你都选 YES,然后下面的Terms of Use 拉下来, I understand and agree to the Terms of Use. * 打勾,保存。
4、然后 Instant Notification URL 填上你刚才那个PHP文件的地址,如 XXX.COM/mail.php 点后面的 TEST,如果有收到信件就代表成功了!
不成功的原因:
1、存放mail.php的webhosting不支持mail函数。
2、邮箱对没有反向解析过的邮件发送,默认设为垃圾邮件件,推荐使用qq邮箱。
3、test的时候,选择2.0,本人测试1.0成功。
另外refund也会提醒。