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 does $_env means?
What is $_ request?
What kind of things have you done on the social side?
How can we execute a php script using command line?
Is key exist in array php?
How to create an empty array in php?
What is the purpose of the following files having extensions: frm, myd, and myi? What these files contain?
Explain about a search-friendly site looks like?
Why do we need session?
What is $row in php?
Which function would you use to format date information in php?
Tell me what is the use of "ksort" in php?
Tell me how is the ternary conditional operator used in php?
Can we use php variable in javascript?
What are the data types in php?