Login Page with md5 Encryption in Password field using PHP/MySQL
Submitted by argie on Thursday, June 28, 2012 - 11:34.
Language
This code will teach you on how to create a login form with md5 encryption. The feature of this code is, it has a input validation and the password are being encrypted using md5. Download and try this code to learn on how to create a login form with md5 encryption.
database name: simple_login
Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.
Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.
FOR YOUR OWN SAFETY, PLEASE:
1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
Comments
Please Help
I've got the username and password and everything done the way you showed it in the tutorial however why is it the connection.php file works for the registration page just fine. Put there seems to be a problem with it being able to see the data that is already in the database. Why Because when I use Richmouse and the password it tell me It can't find it.
Will not go to the home.php page after correct login in.
How do I make it go to the home.php page after the correct login I got that part working.
Problem solved
I found the solution for the connection error. On the "login.php" in the "Create query" replace:
//Create query
$qry="SELECT * FROM member WHERE username='$username' AND password='".md5($_POST['pass'])."'";
$result=mysql_query($qry);
By :
$password = md5($password);
//Create query
$qry="SELECT * FROM member WHERE username='$username' AND password='$password'";
$result=mysql_query($qry);
and enjoy !!!
Problem solved
I found the solution for the connection error. On the "login.php" in the "Create query" replace:
//Create query
$qry="SELECT * FROM member WHERE username='$username' AND password='".md5($_POST['pass'])."'";
$result=mysql_query($qry);
By :
$password = md5($password);
//Create query
$qry="SELECT * FROM member WHERE username='$username' AND password='$password'";
$result=mysql_query($qry);
and enjoy !!!
Add new comment
- Add new comment
- 462 views