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

I am trying to verify the authentication of user login ..

login page is :


<form id="form10" method="post" action="confolog.php">

<fieldset><legend> Personal Information </legend>

User Name : <input type="text" size="15" maxlength ="15" name="Fname"/> &nbsp;&nbsp;

Password: <input type="password" size="15" maxlength="15" name="pwd"/> &nbsp; &nbsp;

<br/>




&nbsp; <input type="submit" value="Submit" name="slog"/>

&nbsp; &nbsp;

<input type="reset" value="Reset" name="res"/>

<br/>


( username and password gets stored in a .txt file)

.txt file would look like :



4b83c256a7ee37fef090378006304e15||8a7d7ba288ca0f0ea1ecf975b026e8e1
88e52ee42fd090896f69d0d71e339d94||d6118c0081ba0ecf1a4f9338d0b21cda

and verification page is



$Fname=$_POST['Fname'];
$pwd=$_POST['pwd'];
$encrypted_myname= md5($Fname);
$encrypted_mypassword= md5($pwd);

//echo "encrypting " . $encrypted_myname;
//echo "encrypting " . $encrypted_mypassword;

if (isset($_POST['slog'])){

if($Fname == $encrypted_myname && $pwd == $encrypted_mypassword) {
echo "welcome back , " . $Fname;
}

else {
include ('reglog.php');
echo "username and password do not match ";
}
}

else{
include ('reglog.php');
echo "enter your username";
}

i am not able to verify the user authentication ..so where am i going wrong..please do let me know..

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of magic function in php?

918


Does php support function overloading?

908


What is session_start () in php?

931


What is difference between print_r and echo in php?

848


What is encapsulation in php?

933


Why is used in php?

907


Can we set session value in javascript?

977


Do you know how to delete a file from the system?

959


What is use of count() function in php?

971


What are the features of php?

981


What is return value in php?

923


How to convert a json string to an array in php?

992


How can I find my php version?

945


What’s the special meaning of __sleep and __wakeup?

940


Is jquery better than javascript?

929