secure download link?

Discussion in 'PHP' started by matt9b, Nov 19, 2008.

  1. #1
    I'm selling downloadable products, and accepting payment using paypal. I then manually email the download link to the buyer each time, and then manually change the link every 48 hours. This is to try to prevent the link being abused or mis-used. I know paypal can direct buyers to an after-payment page on my website, but I basically would like it active for one download only.

    Is there a way to do this automatically somehow, i.e. provide secure downloads to buyers, for one download only, without me having to send out manual links?

    I'm not an advanced programmer- I just use dreamweaver and edit dreamweaver html code. I have implemented some simple java and php in the past, but a long time ago, so I basically don't know any. It would be helpful if there is a way to do this that I can implement myself (I would prefer not to pay a monthly fee to a service to do this for me, but to set it up to work from my website).

    I hope this makes sense!

    Thanks,

    Matt
     
    matt9b, Nov 19, 2008 IP
  2. imchandan

    imchandan Guest

    Messages:
    50
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #2
    A simple solution,
    first make a table called _after_payment
    with fields id,random_number,downloaded

    In paypal, there is a option to set post payment page(after sucessful payment). suppose you choose it to be _sucess_payment.php..... so when user make the payment and comes back from paypal, it lands to _sucess_payment.php... now check here whether user has really came from paypal or not?(Http_referer or get_env(http_referer))...

    if it is real user, then generate a random number say 3398shhdhhd,
    save this entry in table _after_payment with value of downloaded as 0....
    now give user a link like www.site.com/downloads/3398shhdhhd..... check whether file has already been downloaded or not...i.e. download value 0 or 1... if 1 then deny download.. if 0, then let it download and update or delete that entry from table...

    hope this helps...
    let me know if i can help you further...
     
    imchandan, Nov 19, 2008 IP
  3. Gate

    Gate Peon

    Messages:
    52
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I can code this for you for free

    PM me
     
    Gate, Nov 19, 2008 IP
  4. anupamrekha

    anupamrekha Banned

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    56
    Digital Goods:
    7
    #4
    you can use this a Protected Links Script for this.
     
    anupamrekha, Aug 26, 2012 IP