Hi there, I have been trying for days now, trying to figure out how to make my "Thank You" page for clickbank sales, the page where users are able to download my product after purchasing. Right now, anybody can simply just type in the URL to my download page and simply download my product. I want to protect this page by making it visible only to paying customers. I having no coding or scripting skills what so ever. I was wondering how I go about doing this? Looking at clickbank's site, they provide these two scripts to use: PHP SOURCE: function cbValid() { $key='YOUR SECRET KEY'; $rcpt=$_REQUEST['cbreceipt']; $time=$_REQUEST['time']; $item=$_REQUEST['item']; $cbpop=$_REQUEST['cbpop']; $xxpop=sha1("$key|$rcpt|$time|$item"); $xxpop=strtoupper(substr($xxpop,0,8)); if ($cbpop==$xxpop) return 1; else return 0; } --------- PERL SOURCE: sub cbValid { my($q,$key,$rcpt,$time,$item,$cbpop,$xxpop); $key='YOUR SECRET KEY'; $q='&'.$ENV{'QUERY_STRING'}; $q=~/\Wcbreceipt=(\w+)/; $rcpt=$1; $q=~/\Wtime=(\w+)/; $time=$1; $q=~/\Witem=(\w+)/; $item=$1; $q=~/\Wcbpop=(\w+)/; $cbpop=$1; use Digest::SHA1 qw(sha1_hex); $xxpop=uc(substr(sha1_hex("$key|$rcpt|$time|$item"),0,8)); return 1 if $cbpop eq $xxpop; return 0; } Now, I have no clue how to implement these scripts into my "Thank You Download" page. Can somebody please tell me how to do this?
Haven't tested this but something like what's below should get you started. <?PHP function cbValid() { $key='YOUR SECRET KEY'; $rcpt=$_REQUEST['cbreceipt']; $time=$_REQUEST['time']; $item=$_REQUEST['item']; $cbpop=$_REQUEST['cbpop']; $xxpop=sha1("$key|$rcpt|$time|$item"); $xxpop=strtoupper(substr($xxpop,0,8)); if ($cbpop==$xxpop) return 1; else return 0; } if (cbValid()) { echo "Your thank you page contents"; } else { header("Location: $successpage"); /* redirect */ exit; } ?>
Thanks for the help, but I still can't seem to get it to work, this is what I have tried, I made a file called blahblahblah.php, and put this in it: <?PHP function cbValid() { $key='w8shv90shvhs; $rcpt=$_REQUEST['cbreceipt']; $time=$_REQUEST['time']; $item=$_REQUEST['item']; $cbpop=$_REQUEST['cbpop']; $xxpop=sha1("$key|$rcpt|$time|$item"); $xxpop=strtoupper(substr($xxpop,0,8)); if ($cbpop==$xxpop) return 1; else return 0; } if (cbValid()) { echo "<html> <head> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <META name="robots" content="noindex, nofollow"> <title>congratulations</title> </head> <body> The contents of the Thank You page here... </body> </html>"; } else { header("Location: $successpage"); /* redirect */ exit; } ?>
blahblahblah.php has a $key statement with a missing closing quote and in your echo, you will need to escape the quotes...instead of " put \". What specific error were you getting?
try this... <? function cbValid() { $key='w8shv90shvhs; $rcpt=$_REQUEST['cbreceipt']; $time=$_REQUEST['time']; $item=$_REQUEST['item']; $cbpop=$_REQUEST['cbpop']; $xxpop=sha1("$key|$rcpt|$time|$item"); $xxpop=strtoupper(substr($xxpop,0,8)); if ($cbpop==$xxpop) return 1; else return 0; } if (cbValid()) { echo '<html> <head> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <META name="robots" content="noindex, nofollow"> <title>congratulations</title> </head> <body> The contents of the Thank You page here... </body> </html>'; } else { header("Location: http://yourdomain.com/badvisitor/url"); /* redirect */ exit; } ?> in the echo ' statement above, after the first ' you'll have to escape all following ' or you can go with the " and again will have to escape all the following ". By escaping I mean putting a \ in front of the ", as in: echo "this is a quote \", and here I end my statement.";
why not put your landing page on a completey different site ... with no keywords, metatags or description
Ok, I can hide the Thank-You page now just fine, works well. But now I am wondering is there a way that I can mask the download of the product too? Right now any user can see the full path and URL of the download. Is there a way to hide this?
You can install software suited for this purpose, of which there are many:- http://www.google.com.sg/search?hl=en&q=clickbank+download+page+protector&btnG=Google+Search&meta= The price ranges very widely and while some offer additional installation services for you, others don't. If you're not yet willing to invest time and money to do this, you can still create a few directories with restricted .htaccess and keep changing the location of your Thank You download page once every few days.