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 is a closure in php?

1031


Which function will suitably replace 'x' if the size of a file needs to be checked? $Size=x(filename);

995


What is dao in php?

969


How break and continue while loop in php?

948


What is the sign to start variables in PHP?

1099


What is php7?

1081


What are the ways to define a constant in php?

1015


Where is the functions php in wordpress?

1088


What is a static method php?

1005


What is the use of return in php?

915


What is the best way to avoid email sent through php getting into the spam folder?

994


Require_once(), require(), include(). What is difference between them?

980


How cookies are transported from browsers to servers?

950


Differences between get and post methods?

1038


List functions available to sort an php array?

964