The ajax request is working but the problem I'm having is how to encrypt the data with my PHP function before the request is made?
Here is the JS I'm trying
$("#sensitive_data").blur(function() {
alert($(this).val());
$.ajax({
url: 'db.php?check=<?php echo $object->encrypting_data('+$(this).val()+') ?>',
type: 'POST',
error : function (){ document.title='error'; },
success: function (data) {
alert(data);
}
});
});
It works if I pass a sta开发者_运维知识库tic value in the php function
If I understand right, you're trying to use a PHP function to encrypt client-side data before it's sent to the server.
That's impossible, because you can't call a PHP function on the client-side. I'm also not sure what you want to accomplish.
精彩评论