protect download until paid

Discussion in 'PHP' started by webber09, Jun 10, 2011.

  1. #1
    hi all,

    i am creating a e-commerce website where customers buy a product and then pay through paypal. once they have paid they get automatically sent back to a download page on our site. When they get to this page it automatically starts the download of the product they have just paid for.

    My question is: Is there a way i can 'protect' this download page until they (the customer) have paid for the download.

    Thanks
     
    webber09, Jun 10, 2011 IP
  2. shofstetter

    shofstetter Well-Known Member

    Messages:
    178
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    120
    #2
    you could set a session variable with the redirect page, and only display the file for download if the session variable is set.
     
    shofstetter, Jun 10, 2011 IP
  3. webber09

    webber09 Active Member

    Messages:
    131
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    71
    #3
    just to give me a idea how would i go about doing this??
     
    webber09, Jun 11, 2011 IP
  4. popupwindow

    popupwindow Member

    Messages:
    25
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    38
    #4
    Yes you can. I'm doing it here : popup-window.net
    I can give you paid support if you would like to have.

    Thanks :)
     
    popupwindow, Jun 11, 2011 IP
  5. TheDataPlanet.com

    TheDataPlanet.com Well-Known Member

    Messages:
    503
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #5
    I created a small web app for the exact kind of jobs: http://www.winkcart.com/

    If you want to code your own and you use PayPal. You may want to familiarize yourself with PayPal IPN:

    https://www.paypal.com/cgi-bin/webscr?cmd=p/acc/ipn-info-outside
    https://www.paypal.com/ipn

    Basically once the payer makes the payment the payment status would be 'Completed' and PayPal would notify your script. When your script verifies that it's a legitimate and valid transaction notification from PayPal, it then makes changes to your database such as updating the user account as a paid customer, so he has the privileges to download the precious good.
     
    TheDataPlanet.com, Jun 12, 2011 IP