simflex Posted October 30, 2016 Share Posted October 30, 2016 Dear Experts, We have a lot music tracks on our database that we would like to display on a three -column per row layout on our website. Our objective is to have each music and the amount associated with that music next to it and then a download button or link. If a user clicks on that download link, then a link or icon displays asking the user to pay for the music s/he is attempting to download. This is kind of like shopping cart except user can download after making payment. The part that is presenting difficulty for us how to display the music track, the amount, the download link and when user clicks that download link, show pay. Any ideas how to approach this? If there is any link that can help, please let me know. Thanks a lot in advance. Quote Link to comment https://forums.phpfreaks.com/topic/302436-pay-to-download-how-do-i-handle-this/ Share on other sites More sharing options...
requinix Posted October 30, 2016 Share Posted October 30, 2016 Either change the link so that it takes them to the purchase page, or make the download link redirect the user (with or without a warning) to the purchase page. When they buy it, redirect them back to the initial page they were on - the one with the link they clicked. If it's not obvious, you never link to the actual music file. Downloads should always be handled by a PHP script which authenticates the user before directly outputting the music file. Really the music itself shouldn't be located anywhere on your server in a place that someone could access it over the web. Quote Link to comment https://forums.phpfreaks.com/topic/302436-pay-to-download-how-do-i-handle-this/#findComment-1538802 Share on other sites More sharing options...
NotionCommotion Posted October 30, 2016 Share Posted October 30, 2016 If it's not obvious, you never link to the actual music file. Downloads should always be handled by a PHP script which authenticates the user before directly outputting the music file. Really the music itself shouldn't be located anywhere on your server in a place that someone could access it over the web. Agreed. Instead of having PHP directly manage the download, however, you can use something like X-Sendfile, and have PHP only manage the authentication. Quote Link to comment https://forums.phpfreaks.com/topic/302436-pay-to-download-how-do-i-handle-this/#findComment-1538803 Share on other sites More sharing options...
simflex Posted October 30, 2016 Author Share Posted October 30, 2016 Thank you guys so much. This is probably the part you may dislike the most but can you please give me some sample of how to do this? If there is a link to where this has been done before, that would be very helpful as well. Quote Link to comment https://forums.phpfreaks.com/topic/302436-pay-to-download-how-do-i-handle-this/#findComment-1538806 Share on other sites More sharing options...
requinix Posted October 30, 2016 Share Posted October 30, 2016 On how to do... what? There are multiple options here that you should do some research on and think about before jumping right into the code. Quote Link to comment https://forums.phpfreaks.com/topic/302436-pay-to-download-how-do-i-handle-this/#findComment-1538807 Share on other sites More sharing options...
Jacques1 Posted October 30, 2016 Share Posted October 30, 2016 I assume the “payments” involve actual money? Then this isn't the kind of task you can handle with copypasta from the interwebs. The approach already irritates me. If you cannot – excuse my French – write a friggin' link script after somebody has explained it to you, how on earth are you going to implement a safe payment process? There are two options: Install a mainstream shop application which supports virtual products and can be customized enough to fit your needs. Hire(!) an actual(!) programmer to implement a custom solution. This will be expensive and risky, because there are a lot of people who also try the copypasta route and like to disppear when you need them the most. 1 Quote Link to comment https://forums.phpfreaks.com/topic/302436-pay-to-download-how-do-i-handle-this/#findComment-1538810 Share on other sites More sharing options...
simflex Posted October 31, 2016 Author Share Posted October 31, 2016 Hi Jacques, I am beginning to think that it is the way that I frame my questions that give the experts the wrong impression about what I can or cannot do. I have actually implemented, quite successfully, shopping cart app. If I didn't specify so, I would like to say that the only issue I am struggling to figure out is how to show the product, the price and download link. The big issue for me is when a user clicks the download link, rather then show the product to download but to show them pay link and if the user pays, then the download reappears and this time, the user is able to download the music. Unless I am wrong, I think is different from straight up shopping cart where user clicks add to cart, checkout or continue etc. So, the issue with me is NOT how to implement shopping cart because I have done that using php, classic asp and asp.net. The issue is how to present download and user clicks on download, rather than show the product to download but to show pay for the item link. Sorry if it makes look like I need to hire a programmer. As you know from experience, no matter how good you think you are, there are things you struggle to figure out. thanks for you help Quote Link to comment https://forums.phpfreaks.com/topic/302436-pay-to-download-how-do-i-handle-this/#findComment-1538815 Share on other sites More sharing options...
kicken Posted October 31, 2016 Share Posted October 31, 2016 Unless I am wrong, I think is different from straight up shopping cart where user clicks add to cart, checkout or continue etc. Not really. Your download link would just do the equivalent of adding the item to the cart then going to straight to the checkout page for the user to enter their payment information. Once the payment goes through successfully you'd then re-direct them somewhere to download the song. Quote Link to comment https://forums.phpfreaks.com/topic/302436-pay-to-download-how-do-i-handle-this/#findComment-1538816 Share on other sites More sharing options...
ginerjm Posted October 31, 2016 Share Posted October 31, 2016 The thing I have to bring up - and I'm surprised I am the first to do so - is: Do you have the right to be charging for this music? Or do you just have this fabulous collection of oldies or such that you think there may be a demand for? I, for one, would not be helpful at all to anyone stealing money from the artists' who created this treasure trove. Quote Link to comment https://forums.phpfreaks.com/topic/302436-pay-to-download-how-do-i-handle-this/#findComment-1538819 Share on other sites More sharing options...
simflex Posted October 31, 2016 Author Share Posted October 31, 2016 First ginerjim, With all due respect, you shouldn't be the moral warrior here. Second, I am doing this for a musical group who has the right to charge for their music, thank you. Quote Link to comment https://forums.phpfreaks.com/topic/302436-pay-to-download-how-do-i-handle-this/#findComment-1538824 Share on other sites More sharing options...
simflex Posted October 31, 2016 Author Share Posted October 31, 2016 Thank you kicken for providing the most useful information to my question. Quote Link to comment https://forums.phpfreaks.com/topic/302436-pay-to-download-how-do-i-handle-this/#findComment-1538825 Share on other sites More sharing options...
ginerjm Posted October 31, 2016 Share Posted October 31, 2016 And why can't I be the 'moral warrior' here? Do you have info that would indicate that I am not a moral person? Thankfully you have told us that you are in fact the owner of this music so the point is moot, but still your statement boggles me. Quote Link to comment https://forums.phpfreaks.com/topic/302436-pay-to-download-how-do-i-handle-this/#findComment-1538838 Share on other sites More sharing options...
simflex Posted November 2, 2016 Author Share Posted November 2, 2016 I am a classic asp/.net/sql server developer. Once in a while, I make a foray into php and I have not done it consistently well enough to get a hang of it but doesn't discourage me from trying. However, one thing I have noticed is that someone is seriously in need of help. S/he posts a question. Several well intentioned helpers come up with some useful suggestions on how to help the OP. Some provide sample code. Then there is *always* someone who feels he needs to be heard and then comes up with some silly comments, none of which helps the OP looking for help. Whether the music is mine and I decide to sell it, how does your comment help me???? You can decide that you have a solution to my problem but since I am not giving it away, you would not help me. That's completely within your rights but don't come here wasting a space just to make some unrelated comments. I said I have some music in our database. There is no way a reasonable individual would infer that it is mine and even if it is, I am not asking a Priest if I can or cannot sell it. I am asking for CODING help. That is why NO ONE but you ventured into that moral space. Quote Link to comment https://forums.phpfreaks.com/topic/302436-pay-to-download-how-do-i-handle-this/#findComment-1538864 Share on other sites More sharing options...
NotionCommotion Posted November 2, 2016 Share Posted November 2, 2016 I said I have some music in our database. There is no way a reasonable individual would infer that it is mine and even if it is, I am not asking a Priest if I can or cannot sell it. I am asking for CODING help. That is why NO ONE but you ventured into that moral space. So, are you inferring that ginergm is the only moral individual here? There have been previous questions asking how to implement some unethical or illegal script, and members of this forum typically offered no help. Now, if you have a legal right to sell them, they have been been very forthcoming. Quote Link to comment https://forums.phpfreaks.com/topic/302436-pay-to-download-how-do-i-handle-this/#findComment-1538869 Share on other sites More sharing options...
ginerjm Posted November 2, 2016 Share Posted November 2, 2016 You have written so much English about nothing here. If you can't see that the attitude I expressed is definitely worthy of saying then you have the problem, not us on the forum. To help a possible illegal operation in the making would be not only immoral but possibly prosecutable should the real copyright owner decide to pursue all who brought this to fruition. Go back to "classic asp/.net/sql" where apparently such concerns of legality aren't expressed. Here in the PHP world we do have some morals and concerns other than "CODING help". Quote Link to comment https://forums.phpfreaks.com/topic/302436-pay-to-download-how-do-i-handle-this/#findComment-1538870 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.