How to encrypt user password in php. please explain in a way a beginner can understand. I already have this sample code:
$password="john856";
$encrypt_password=md5($password);
echo $encrypt_password;
Can you help me incorporate it in my current code, which does not do any encryption.
<?php
$con = mysql_connect("localhost","root","");
if (!$con) { die('Could not connect: ' . mysql_error()); }
mysql_select_db("koro", $con);
$sql="INSERT INTO users
(LNAME, FNAME, MNAME, UNAME, PW)
VALUES
('$_POST[Lneym]', '$_POST[Fneym]', '$_POST[Mneym]', '$_POST[Uneym]', '$_POST[Pass]')";
if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); }
echo "<script>alert('User Added!You can now use the system')</script>";
mysql_close($con)
?>