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 difference between strstr() and stristr()?
Is php front end?
Where php language is used?
In php, how to redirect from one page to another page?
List the different types of print functions available in php?
What's the difference between using mysql_ functions and pdo?
Why post method is used in php?
How to calculate the length of a string?
Tell me how to create a session? How to set a value in session? How to remove data from a session?
When use javascript vs php?
What is form action php?
How to protect special characters in query string?
How to connect to a url in php?
How to list all values of submitted fields?
How to assigning a new character in a string?