How can we encrypt the username and password using PHP?
Answer Posted / zahid
$username = $conn->escape_string($_POST['usernmae]);
$password = $conn->escape_string($_POST['password]);
$sql ="SELECT usernmae,password,id from login where md5(usernmae)='$username' and md5(password)='$password';";
$row = $conn->query($sql);
if($row->num_rows >0){
echo "login success";
}
else{
echo "Invalid credentaisl";
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the use of htmlspecialchars in php?
How to redirect a page in php?
What is a variable cost example?
Are php short tags acceptable to use?
Tell me how can I display text with a php script?
What is good average session duration?
Which variable declarations within a class is invalid in php?
what is the current salary package in India for a PHP programmer who has 1.5 years experience
Explain the difference between array_merge() and array_combine()?
How do I use isdigit function?
What is difference between print_r and echo in php?
Which is correct about mysqli and pdo?
What is the use of super-global arrays in php?
How to connect to mysql from a php script?
Is php an api?