Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2004
    NJ, USA

    Password Protection

    Hello Everyone,

    I really need some help. I'm trying to password protect a directory on my website (to store a demo software). I want it to be in such a way, that the user should have access to the directory (with username & password), but after 1 download, his or her username / password should become inactive. It will be for multiple users.

    Would really appreciate help or right direction if any such script exists. I do have PHP & MySQL on my hosting server.

    Best regards,


  2. #2
    Join Date
    Jul 2003
    If you are trying to password protect a file, just generate a random download key and set it to expire in a day (you cannot find out from HTTP if the download was successful or not).

    So, generate a table with keys and expire dates. Hand these keys to your clients. When the expire date has passed, the key is invalid and the software fails to download.

    Of couse, to do this successfully, you would have to move the software outside your webroot, so no one can simply link to it. If that is not a possibility, atleast add a .htaccess rule to that directory that prevents browsing. Something like Deny From All.

    A lot of ways to secure this, choose the one that best suits your application.
    In order to understand recursion, one must first understand recursion.
    If you feel like it, you can read my blog
    Signal > Noise

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts