Jump to content

Archived

This topic is now archived and is closed to further replies.

elementz

Unique Link Download

Recommended Posts

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

Share this post


Link to post
Share on other sites
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 downloads
echo "<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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.