elementz Posted April 7, 2006 Share Posted April 7, 2006 Anyone know a tutorial or script that makes a unique link download that can be limited to x downloads. I am going to intergrate it with IPN so I can make my own download manager and save money. If you have any suggestions or help, please post it.Thankyou,Luke Quote Link to comment Share on other sites More sharing options...
JackJack Posted April 7, 2006 Share Posted April 7, 2006 You could make a mysql table and use a code like this :[code]<?include("configfile"); $sel = mysql_query("SELECT * FROM downloads WHERE name='dowload'"); while ($download = mysql_fetch_array($sel)){if($download[times] <= 5){//5 is max number of downloadsecho "<a href=download.zip >Download.zip</a><br>";}else{echo "No downloads."}if (url = "www.yoursite.com/download.zip"){mysql_query("UPDATE downloads set times=$download[times]+1 WHERE name='download'");[/code] I think that may work Quote Link to comment Share on other sites More sharing options...
txmedic03 Posted April 7, 2006 Share Posted April 7, 2006 You don't want people to have the actual address to the file. I suggest using the header() to pass content type and pass the content of the file to the user if the proper conditions are met. Alternatively you could create temporary downloads that expire after 24 hours or something. You could have temporary directory and move the files the user requests to that directory if the criteria is met then have the file removed in 24 hours. Quote Link to comment Share on other sites More sharing options...
elementz Posted April 8, 2006 Author Share Posted April 8, 2006 Can you show and example please?Thankyou,Luke Quote Link to comment Share on other sites More sharing options...
txmedic03 Posted April 8, 2006 Share Posted April 8, 2006 I'll look around and see if I can find an example otherwise I may have to write one myself. I might write one anyway since I will probably need one myself. Quote Link to comment 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.