Encrypting Password with special Characters using PHP
Â
Hello! I’m new to PHP and been doing research on how to put special characters of encrypted password. Will there be anyone who can share about this? Please Share. Thanks.
Â
Hello! I’m new to PHP and been doing research on how to put special characters of encrypted password. Will there be anyone who can share about this? Please Share. Thanks.
You can use crypt() OR MD5 function for encrypting password in PHP–
crypt() function can be used in following way-
<?php
$stored_pass="hello world"; //This is the password from the database for that particular user
$usr_input="hello world"; //This is the password submitted by the user for login
$password = crypt($usr_input); //It will encrypt the input
/* this will compare both password*/
if (crypt($stored_pass, $password) == $password) {
 print "Password verified!";
}
else{
   print "Password not verified";
{
?>
Â
Â
Â
Â