Encrypting Password with special Characters using PHP

Asked By 20 points N/A Posted on -
qa-featured

 

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.

SHARE
Answered By 0 points N/A #104285

Encrypting Password with special Characters using PHP

qa-featured

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";
{
?>

 

 

 

 

Related Questions