Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is csrf cookie?

981


What is meant by pear in php? What is the purpose of it?

1010


Which method removes the last element from the end of an array?

1017


Why are sessions used?

1012


What is encapsulation in php?

1038


What is php rest api?

1072


What is session in c#?

1035


What is array and function?

1104


What is the difference between for and foreach in php?

1117


How does session work in php?

1070


How does csrf token work?

1072


How we get ip address of client, previous reference page etc?

1022


Is laravel frontend or backend?

1009


What is the delimiter syntax is PHP's default delimiter syntax

1325


Explain a resource?

1076