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
Are php short tags acceptable to use?
How to redirect a url from http to https in .htaccess?
What is framework? How it works? What is advantage?
What is the difference between file_get_contents() and file_put_contents() in php?
What is framework in php for beginners?
How can we display information of a variable and readable by human with php?
How do I use isdigit function?
Tell me what's the difference between include and require?
How does the identity operator === compare two values?
What does php do?
Why json is used in php?
What is x+ mode in fopen() used for?
How to genrate report in wordpress cms
where do we use htaccess?
What happens if an expected input field was not submitted?