Jump to content


Photo

Unique Link Download


  • Please log in to reply
4 replies to this topic

#1 elementz

elementz
  • Members
  • PipPipPip
  • Advanced Member
  • 36 posts

Posted 07 April 2006 - 09:09 AM

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

#2 JackJack

JackJack
  • Members
  • PipPipPip
  • Advanced Member
  • 38 posts

Posted 07 April 2006 - 10:18 AM

You could make a mysql table and use a code like this :

<?

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'");




I think that may work

#3 txmedic03

txmedic03
  • Members
  • PipPipPip
  • Advanced Member
  • 313 posts
  • LocationCall, TX, USA

Posted 07 April 2006 - 02:40 PM

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.

SEMPER FIDELIS!

I can't stop you from doing something silly, but at least I can help you do it right.


#4 elementz

elementz
  • Members
  • PipPipPip
  • Advanced Member
  • 36 posts

Posted 08 April 2006 - 01:02 AM

Can you show and example please?

Thankyou,
Luke

#5 txmedic03

txmedic03
  • Members
  • PipPipPip
  • Advanced Member
  • 313 posts
  • LocationCall, TX, USA

Posted 08 April 2006 - 04:10 AM

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.

SEMPER FIDELIS!

I can't stop you from doing something silly, but at least I can help you do it right.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users