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
Does php need to be installed?
What is csrf validation?
What is helper library?
What is the function func_num_args() used for?
Explain the difference between isset() and empty()?
Explain what are psrs?
Is salary fixed or variable cost?
Why do we use polymorphism in php?
Why do we use query?
How to create a session? How to set a value in session?
Why delimiter is used in mysql?
How can we set and destroy the cookie in php?
What is the default time in seconds for which session data is considered valid?
Is php a framework?
Why is facebook still using php?