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 csrf cookie?
What is meant by pear in php? What is the purpose of it?
Which method removes the last element from the end of an array?
Why are sessions used?
What is encapsulation in php?
What is php rest api?
What is session in c#?
What is array and function?
What is the difference between for and foreach in php?
How does session work in php?
How does csrf token work?
How we get ip address of client, previous reference page etc?
Is laravel frontend or backend?
What is the delimiter syntax is PHP's default delimiter syntax
Explain a resource?