View Full Version : Login Script...
Rockonmetal
12-08-2007, 10:10 PM
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!!!!
farmdve
12-08-2007, 10:11 PM
Check google
Rockonmetal
12-08-2007, 10:12 PM
I'd Rather not check google because I did before but i got a bunch which were overcomplicated and stuff like that...
thetestingsite
12-08-2007, 10:18 PM
check this site:
http://www.php-mysql-tutorial.com/user-authentication/database.php
Hope this helps.
Rockonmetal
12-08-2007, 11:21 PM
This is something that looks like what i am trying to accomplish
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
thetestingsite
12-08-2007, 11:42 PM
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.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.