Simple Password Protection

Discussion in 'PHP' started by mmelen, Dec 28, 2008.

  1. #1
    Is there a script/tutorial to help me install simple password protection for my site.

    - MySQL or some Array of member usernames and passwords.
    - Enter username/password to enter the website.

    Thanks in advance for any help.
     
    mmelen, Dec 28, 2008 IP
  2. phper

    phper Active Member

    Messages:
    247
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #2
    For simple authentication, you can use the 'Basic' or 'Digest' authentication from Apache: http://www.php.net/features.http-auth

    With this, you wouldn't need to worry about storing / checking / destroying the login details in a session. Just put the authentication code in a file, then make all your PHP scripts to include() that file.
     
    phper, Dec 28, 2008 IP
  3. Pixel T.

    Pixel T. Well-Known Member

    Messages:
    1,205
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    170
    #3
    Pixel T., Dec 28, 2008 IP
  4. mmelen

    mmelen Well-Known Member

    Messages:
    1,526
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    105
    #4
    Followed the tutorial and set it up. Please do send me that updated logout page if you can. Thanks!
     
    mmelen, Jan 2, 2009 IP