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?

Answers were Sorted based on User's Feedback



How can we encrypt the username and password using PHP?..

Answer / sreedevi

i think by using MD5 or sha1

Is This Answer Correct ?    40 Yes 3 No

How can we encrypt the username and password using PHP?..

Answer / master

best is to use md5() or sha1(). base64_encode is not
actually encoding used for username or password.

Is This Answer Correct ?    27 Yes 0 No

How can we encrypt the username and password using PHP?..

Answer / vivek

md5()or sha1()

Is This Answer Correct ?    14 Yes 2 No

How can we encrypt the username and password using PHP?..

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

How can we encrypt the username and password using PHP?..

Answer / susanta karmakar

By using base64_encode() we can encrypt the username and
password.

Is This Answer Correct ?    14 Yes 5 No

How can we encrypt the username and password using PHP?..

Answer / vikash

md5() is the best method for encrypting the username and
password.

Is This Answer Correct ?    7 Yes 0 No

How can we encrypt the username and password using PHP?..

Answer / indrajit saha

This is an example Login with encrypted password:-
---------------------------------------------------
<?php
echo "Encrypting <b>testing</b> using md5: ".md5("testing");
echo "<br />";
echo "Encrypting <b>testing</b> using sha1: ".sha1("testing");
?>

Output:-
---------
Encrypting testing using md5: ae2b1fca515949e5d54fb22b8ed95575
Encrypting testing using sha1:
dc724af18fbdd4e59189f5fe768a5f8311527050

Is This Answer Correct ?    8 Yes 1 No

How can we encrypt the username and password using PHP?..

Answer / guru

I am using md5 function

Is This Answer Correct ?    2 Yes 1 No

How can we encrypt the username and password using PHP?..

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

How can we encrypt the username and password using PHP?..

Answer / amit

using crypt()

Is This Answer Correct ?    3 Yes 4 No

Post New Answer

More PHP Interview Questions

What is the difference between urlencode and urldecode ?

3 Answers  


Why do we show php code in browser?

0 Answers  


What is a helper function?

0 Answers  


how to make website package setup like desktop software setup ... that front end and backend can include in setup like single package...?

0 Answers  


How can we extract string ‘abc.com ‘ from a string info@abc.com" target="_blank">http://info@abc.com using regular expression of php?

6 Answers  


What is inheritance in php with example?

0 Answers  


What is the importance of parser in php?

0 Answers  


Which php framework is best?

0 Answers  


how to overcome server time behind twleve hours compare to local system time

0 Answers  


How can we extract string ?allinterview.com ? from a string ?http://info@allinterview.com? using regular expression of PHP?

6 Answers  


How can you retrieve data from the mysql database using php?

0 Answers  


How to call php function in jquery?

0 Answers  


Categories