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

Does php need to be installed?

879


What is csrf validation?

1002


What is helper library?

883


What is the function func_num_args() used for?

910


Explain the difference between isset() and empty()?

894


Explain what are psrs?

876


Is salary fixed or variable cost?

940


Why do we use polymorphism in php?

955


Why do we use query?

870


How to create a session? How to set a value in session?

936


Why delimiter is used in mysql?

1008


How can we set and destroy the cookie in php?

912


What is the default time in seconds for which session data is considered valid?

1045


Is php a framework?

898


Why is facebook still using php?

1016