Jquery 使用哈希sha-512在数据库中使用加密密码验证表单中的密码

Jquery 使用哈希sha-512在数据库中使用加密密码验证表单中的密码,jquery,encryption,passwords,password-encryption,Jquery,Encryption,Passwords,Password Encryption,使用哈希SHA-512在数据库中使用加密密码验证表单中的密码我尝试做的是专门针对更改密码表单 我可以验证表单和数据库中的密码是否未加密。。。但我无法验证输入的密码是否等于数据库密码,因为输入的密码仍然是正常形式,并且数据库中的密码是加密密码 我想使用jQuery验证功能…但在提交之前,我一直坚持用数据库加密输入的密码来解决这个问题 function Validate(data) { if(data==true) { //submit the form } else {

使用哈希SHA-512在数据库中使用加密密码验证表单中的密码我尝试做的是专门针对更改密码表单

我可以验证表单和数据库中的密码是否未加密。。。但我无法验证输入的密码是否等于数据库密码,因为输入的密码仍然是正常形式,并且数据库中的密码是加密密码

我想使用jQuery验证功能…但在提交之前,我一直坚持用数据库加密输入的密码来解决这个问题

function Validate(data)
{
  if(data==true)
  {
   //submit the form
  }
  else
  {
   //dont submit the form. Throw an error/alert
   return false;
  }
}

//when the form is submitted
$("#yourForm").submit(function()
{
var p=$("#oldPassword").val();
$.post("validate.php",{oldpass:p},Validate);
});
PHP部分(validate.PHP)


这绝对不是他想要的。。。你读过他的问题吗?很可能不是


我是一个女人,呵呵……顺便说一句。我很快会回复的。谢谢你的指导。
<?php

$oldpassword=$_POST['oldpass'];

//encrypt $oldpassword to md5 or anything as per your requirement
//and compare it with the encrypted password available in the database

if($oldpassword==$dbpass)
{
   $status=true;
}
else
{
   $status=false;
}

echo $status;
?>
function Validate(data)