Hi
Just a thought but this is how I might do it....
- Customer table [id_usr]
- Products table [id_prd]
-
- which contains all of the music files you intend to sell, including the filename and location, also the sample filename and location if you intend to show that.
- xref id_prd - id_usr
-
- this contains the list of files bought by the user OR
- use the orders table but this involves storing more information and because the filename may change on the server as you update it, this information will become out of date
The x-reference rows would be created at the time the order is processed and the payment accepted. In this table you could store the date the file was bought, reference back to the order/invoice number, number of downloads (initially 0 [zero]).
When they are redirected to the download page it could show them the number of downloads they have remaining, much like interakt use. Set a max number of downloads in your code or a config file.
If you then use the download file SB they will never know where the file is stored on your server... issue this cannot be done over SSL on IE. so you cannot use https:// with download file if the client is on Internet Explorer, any version. Known bug!
Do not whatever you do, allow the user to see where the files are coming from.. any good hacker would try to access the files by dictionary attacking the folder which the format of filename you are using. They might get lucky, but more than likely they will just clog your server up.
By stored the date and the number of downloads, you have 2 ways to stop the user downloading it too many times. Times out or runs out of download attempts. Build a system though where you can reset the number of downloads used. However it would be useful to store the total number of downloads by that user of that file, even if it is reset. So have 2 fields, current downloads [resetable], total downloads [non-resetable].
When implementing paypal though MXKart it asks for the return page, this should be the return.php page in MXKart, however from return.php you can then bounce them to the downloads page.
Using the orders/history.php file you can show all the music files they have bought by querying the xref table.
Hope that helps. Probably only take a couple or so days to implement once the shop and paypal are fully functional.
Hope that helps!
Gareth