August 17, 200917 yr I have a client selling an e-book and he is not expecting huge downloads but still wants protection... The system Im settin up is a simple --- domain.com -- paypal payment --- return user to download page What I want help with is writing some php to go in the download page that means it is only accessible if someone accesses it via paypal/ a referrer - As in people cannot pass around the download link easily... I have also suggested more trivial means like changing the link of the download page once every month or so etc help?
August 18, 200917 yr The code to get a referrers url $ref=getenv("HTTP_REFERER"); In terms of changing the URL, how about just changing the id of the page instead. So the URL might look like this the first month: http:// www.domain.com/ Download.php?id=12345 And then might look like this the second month: http:// www.domain.com/ Download.php?id=54321 And then if you combine that with mod_rewrite you could rewrite the urls like this: 1st Month: http:// www.domain.com/ Download/12345.php 2nd Month: http:// www.domain.com/ Download/54321.php Edit: Spaces added to URLs to remove auto linking.
August 21, 200917 yr The best solution would be to use Paypal IPN (Instant Payment Notification) that way you could email or force the download only after a successful payment. IPN can be a challenge to get your head around but it's certainly the best way to go if you are using Paypal. Edit: Just thought I would give a bit more detail. Paypal posts back to you after a payment is made and there are ways for you to check and confirm a valid payment. After checking, you would serve up the download!
August 21, 200917 yr You can fake the details supplied from PHP's $_SERVER['HTTP_REFERER'] variable. Why don't you use a .htaccess file in the directory, and do something with the {HTTP_REFERER} variable in there instead? A quick Google search has brought up loads of results for info on how to set it up.
Create an account or sign in to comment