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 the use of htmlspecialchars in php?

953


How to redirect a page in php?

989


What is a variable cost example?

983


Are php short tags acceptable to use?

908


Tell me how can I display text with a php script?

940


What is good average session duration?

974


Which variable declarations within a class is invalid in php?

938


what is the current salary package in India for a PHP programmer who has 1.5 years experience

2943


Explain the difference between array_merge() and array_combine()?

960


How do I use isdigit function?

1013


What is difference between print_r and echo in php?

860


Which is correct about mysqli and pdo?

1040


What is the use of super-global arrays in php?

920


How to connect to mysql from a php script?

1013


Is php an api?

947