<?php
$password = 'nilpointer.net';
$hash = md5($password);
echo 'password: '.$password;
echo '<br>hash: '.$hash;
$input_password = 'nilpointer.net';
if($hash == md5($input_password)) {
echo '<br>Password is Valid';
} else {
echo '<br>Invalid Password';
}
?>
Output
password: nilpointer.net
hash: 02af4c4d343135b4ee085a75ca5f4bbc
Password is Valid