turn a solution that reveals password to a secure solution
I want to make a password check where the javascript variable is the
password that the user has written. I want to check if it is correct and I
did that by comparing what the user wrote to my php variable which stores
the actual value.
This is not a secure solution. How can I change it. I want the if
statement to be at the same place as before?
Her is my code:
var password=$("#password").val();
if(password!='<?php echo "$password"; ?>'){
alert("No changes has been made due to wrong password.");
}
else{
$.ajax({
type: "POST",
url: "modify_profile.php",
data: {"firstname":firstname,"lastname":lastname},
success: function( data){
}
});
}
});
No comments:
Post a Comment