<?php $pass="admin"; md5($pass);//Encryption of the password to make it more secure ?>
By the Screenshot given below you can differentiate that md5() converts the same password admin into the long string, so that it is more complicated that someone can crack your password easily.
Password generated by the md5() is not the random numbers it is fix means every time if you will encrypt the “admin” then you will get the same result “21232f297a57a5a743894a0e4a801fc3”;
Implementation of the md5() into the Login form:
<?php //Fetching username and password sent from form $username=$_POST['username']; $password=$_POST['password']; // Password Encryption $new_password=md5($password); $query="SELECT * FROM user_data WHERE userId ='$username' and user_password ='$new_password'"; $result=mysql_query($query); ?>
but don’t forget to save the password into the Encrypted form when user is doing Signup or Registration. Create the Login Module Click Here.
You have done, now use the secure feature of the PHP, Thanks and Enjoy the coding.