0
I need to compare the fields according to the script below:
$("#send_request").submit(function(event){
var password = '7c4a8d09ca3762af61e59520943dc26494f8941b';
if($('#userpassword').val()!=password){
alert('senha invalida');
}
event.preventDefault();
});
Only that the password of userpassword
of this field, will come without encryption, so I will have to encrypt before comparing. But the form passes directly, nor compares and does not give anything. How should I do?
Don’t send passwords to the client side! Even if you do
var pwd = <?= pd ?>;
this will be accessible by the user. Also a hashed encrypted password is never equal to a password entered in a fieldinput type="password"
. You have to use ajax, send it to PHP and compare it there.– Sergio