1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Password Protecting a .PHP Page?

Discussion in 'Programming' started by hsaleem, May 6, 2007.

  1. #1
    How can I get this done?

    When someone places an order and the payment is processed through PayPal, the buyer should be taken to Download the stuff he/she has ordered. I would further want to limit that buyer to download the product just once or twice (at most) and then it shouldn't be available to that user.

    Currently I send an email with a link to download which gives the idea to the buyers where is the file located and that isn't safe.

    Is there a script or something that can protect a .php or .html page with a password?

    What are my options?
     
    hsaleem, May 6, 2007 IP
    8everything likes this.
  2. Cypherus

    Cypherus Peon

    Messages:
    1,551
    Likes Received:
    102
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You could try storing information of every download in a database. That would you could prevent someone from downloading it twice!

    I don't think protecting the php file itself would be a good solution!
     
    Cypherus, May 6, 2007 IP
  3. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #3
    1. Store files underneath webroot
    2. Create a database for downloads that recognizes your clients usernames
    3. read the rest of this post
    4. I got nothing, overstretched with a numbered list really, thought it would better than it is

    What was that, anyway, store files underneath your webroot, they will not be accessible via the web, but php ( or whatever ) can still read and write them, you need to have a database that will recognize the usernames of your clients, you need to implement a unique link somehow to your files, then you need to output the file with readfile(), count the bytes read, if the user cancels or doesn't get the whole download you'll know, update your database accordingly, thats it I think ......
     
    krakjoe, May 6, 2007 IP
    saadahmed007 and hsaleem like this.
  4. jgjg

    jgjg Peon

    Messages:
    595
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Dreamweaver has some password protect php page tools.

    Does require a database connection and usernames and passwords but is pretty easy to set up.
     
    jgjg, May 9, 2007 IP
    hsaleem likes this.
  5. gibex

    gibex Active Member

    Messages:
    1,060
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    95
    #5
    .htaccess, but don't think paypal api will allow you to store u/p from your customers.
     
    gibex, May 12, 2007 IP