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 sticky form in php?
What is print_r?
Explain about looping in PHP?
What are the advantages of stored procedures?
What is include in php?
How to convert the first character to upper case?
What are the string function in php?
Which function will suitably replace 'x' if the size of a file needs to be checked? $Size=x(filename);
What is namespace in php?
Tell me what is the use of "ksort" in php?
What enctype is required for file uploads to work?
What are the differences between GET and POST methods?
How to take a substring from a given string in php?
What is polymorphism in php?
What is meant by variable variables in php?