Results 1 to 6 of 6

Thread: Login Script...

  1. #1
    Join Date
    Jan 2007
    Location
    The stage
    Posts
    568
    Thanks
    23
    Thanked 6 Times in 6 Posts

    Default Login Script...

    I have a Mysql User Database. I want to put a login script so my users can login to my site. I figured out how todo it, but then I forgot. I just need it so that the script checks the username to see if it exists then check to see if the password from that username matches the input that the user put in... Thats all i need... Thanks!!!!

  2. #2
    Join Date
    Dec 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Check google

  3. #3
    Join Date
    Jan 2007
    Location
    The stage
    Posts
    568
    Thanks
    23
    Thanked 6 Times in 6 Posts

    Default

    I'd Rather not check google because I did before but i got a bunch which were overcomplicated and stuff like that...

  4. #4
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    check this site:

    http://www.php-mysql-tutorial.com/us...n/database.php

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  5. #5
    Join Date
    Jan 2007
    Location
    The stage
    Posts
    568
    Thanks
    23
    Thanked 6 Times in 6 Posts

    Default

    This is something that looks like what i am trying to accomplish
    Code:
               WHERE Username = '$userrname' 
                     AND Password = PASSWORD('$password')";
    Now to me this looks like:
    Get the username from variable $username and get the password for that username. Then check to see if its the correct the password... The last part though is a little confusing. PASSWORD('$password')
    I am away from my computer with the files on it so I can't test it... Is my understanding correct of the code? Or did i completely miss something...
    Thanks

  6. #6
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    That's close, but the PASSWORD function is an SQL function that uses it's built-in password encryption method. If you had another encryption method that you used to insert the users into the db, you would want to use that instead (such as MD5, SHA1, etc).

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

Bookmarks

Posting Permissions

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