开发者

Ajax need to be encrypted with PHP function, problem

开发者 https://www.devze.com 2023-02-19 00:34 出处:网络
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?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消