How Do I Redirect If The Visitor Didn't Come From Paypal?
Welcome back!
This seems to me like it *should* be a fairly simple thing but I've been fighting with it all freaking day and still haven't found anything that works. I've got a page that sells a product with Paypal as the payment processor. Making the "Buy Now" button at Paypal merchant services is easy enough, I even remembered to input the success url that the customer needs to go to after payment is taken care of.
The part that's driving me bleeping nuts is that I obviously don't want anyone to be able to load the download page unless they're coming from the link Paypal gives them after they pay.
I figured it should be a simple matter of a rewrite url based on the referrer:
Somebody tries to load example.com/download,
.htaccess, PHP code, whatever checks the http referrer,
if it's paypal, let 'em go on to example.com/download,
if it's anything else, redirect 'em to example.com instead.
About 15 hours of Google time later, I'm no closer to getting this allegedly simple thing to work than when I started. If anybody's got a solution that will work without my feeling the need to shoot somebody or put up a copy of OsCommerce just to sell one item I'd appreciate it a lot.
Technorati Tags: programming, Url, Http Referrer, Redirect, htaccess, Rewrite, php, Success, Checks
Just copy this code and paste it on your site where you want the link to appear:

Wow! No response yet?
Maybe it’s some kind of secret and you have to pass a test or join a club to learn how to do it?