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 / abhijita

This is an example Login with encrypted password but don't
forget to encrypt password and insert into database in sign
up process.

// username and password sent from form
$myusername=$_POST['myusername'];
$mypassword=$_POST['mypassword'];

// encrypt password
$encrypted_mypassword=md5($mypassword);

$sql="SELECT * FROM $tbl_name WHERE username='$myusername'
and password='$encrypted_mypassword'";
$result=mysql_query($sql);

Is This Answer Correct ?    13 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does $_env means?

928


What is $_ request?

970


What kind of things have you done on the social side?

9012


How can we execute a php script using command line?

1043


Is key exist in array php?

987


How to create an empty array in php?

1095


What is the purpose of the following files having extensions: frm, myd, and myi? What these files contain?

951


Explain about a search-friendly site looks like?

858


Why do we need session?

963


What is $row in php?

934


Which function would you use to format date information in php?

970


Tell me what is the use of "ksort" in php?

990


Tell me how is the ternary conditional operator used in php?

1051


Can we use php variable in javascript?

1007


What are the data types in php?

1022