Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Password Protected page

    I want to have one php page password protected. I know the login script could check values in a database but i don't really want to use a database as there will only be one username and one password.

    Can this be done using a text file? how about the security?

    All i really want is for someone to login and view this page that has a list of confidental links to documents on an intranet.

    Thanks

  • #2
    New Coder
    Join Date
    Sep 2003
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If you only need 1 user and 1 pass, then do this

    name="password" in the form

    $hashedpass = md5($password);
    if ($username == "blah" && $hashedpass == "md5 value")

  • #3
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Or you can simply use a .htaccess file with a corresponding .htpasswd file.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts
    cheers

    spookser - how would i use the .htaccess file? have u any decent links on the subject?

  • #5
    Regular Coder
    Join Date
    May 2003
    Location
    34° 54' N 82° 13' W
    Posts
    996
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Stevie Peele
    Neverside IRC Network - irc.veonex.net | tc.tutorialnetwork.org
    #dev - any programming,etc. question
    #design - design discussion and critque
    #central - general chat
    Come join us!

  • #6
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #7
    Regular Coder
    Join Date
    Mar 2003
    Posts
    241
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If you had tried the search-link at the top of the forums, maybe you would have found this excellent tutorial:
    Comprehensive guide to .htaccess

    My search for "htaccess" resulted in 3 pages !!

    Acknowledge the searchengine and you'll save yourself and others some valuable time!

    Hey, i'm thinking of putting that into my signature


    Edit: I mean no harm, i'm in a weird mood today... but still, you could probably have used the searchengine
    Last edited by Caffeine; 10-28-2003 at 01:35 PM.


  •  

    Posting Permissions

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