How can we encrypt the username and password using PHP?
Answer Posted / abhijita
This is an example Login with encrypted password but don't
forget to encrypt password and insert into database in sign
up process.
// username and password sent from form
$myusername=$_POST['myusername'];
$mypassword=$_POST['mypassword'];
// encrypt password
$encrypted_mypassword=md5($mypassword);
$sql="SELECT * FROM $tbl_name WHERE username='$myusername'
and password='$encrypted_mypassword'";
$result=mysql_query($sql);
| Is This Answer Correct ? | 13 Yes | 3 No |
Post New Answer View All Answers
What is a closure in php?
Which function will suitably replace 'x' if the size of a file needs to be checked? $Size=x(filename);
What is dao in php?
How break and continue while loop in php?
What is the sign to start variables in PHP?
What is php7?
What are the ways to define a constant in php?
Where is the functions php in wordpress?
What is a static method php?
What is the use of return in php?
What is the best way to avoid email sent through php getting into the spam folder?
Require_once(), require(), include(). What is difference between them?
How cookies are transported from browsers to servers?
Differences between get and post methods?
List functions available to sort an php array?