the_oliver Posted July 18, 2007 Share Posted July 18, 2007 Hello, Im trying to do something where by when some one pays for something, and the payment is confirmed they are able to download a file. The bit i cant work out is how to let them download the file. I could just give them the link only once they have paid, however this would meen that they could give anyone the link. So i need a way to make downloads only possible by people who have paid, not anyone who knows the URL. Can anyone suggest anything? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/60667-solved-download-if-payed/ Share on other sites More sharing options...
trq Posted July 18, 2007 Share Posted July 18, 2007 Take a look at the force downloads script in the FAQ/Code snippet forum. All you need do is wrap that in an if() that only allows users who have paid to execute the download. Quote Link to comment https://forums.phpfreaks.com/topic/60667-solved-download-if-payed/#findComment-301821 Share on other sites More sharing options...
the_oliver Posted July 18, 2007 Author Share Posted July 18, 2007 Thank you, So when using that can i put the file outside the webservers directory? (so as to stop the whole anyone gessing the url thing!). And specify where the file is in this bit: $file = $_REQUEST['file']; so it could be $file = $_REQUEST['/stor/file.someting']; Excuse my ignorance! Quote Link to comment https://forums.phpfreaks.com/topic/60667-solved-download-if-payed/#findComment-301827 Share on other sites More sharing options...
trq Posted July 18, 2007 Share Posted July 18, 2007 So when using that can i put the file outside the webservers directory? Exactly right. Quote Link to comment https://forums.phpfreaks.com/topic/60667-solved-download-if-payed/#findComment-301836 Share on other sites More sharing options...
the_oliver Posted July 18, 2007 Author Share Posted July 18, 2007 Grate! Many Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/60667-solved-download-if-payed/#findComment-301838 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.