I have the following Jquery function that should post  memberID as a variable.And I want to catch it in my add_comment.php file with   $memberID = $_REQUEST['memberID'] but it returns null.
$('a.comment').die("click").live("click", function(e){
        var getpID =  $(this).parent().attr('id').replace('commentBox-','');    
        var comment_text = $("#commentMark-"+getpID).val();
        if(comment_text != "Write a comment...")
 开发者_运维知识库       {
            $.post("lib/actions/add_comment.php?comment_text="
                      +comment_text+"&post_id="+getpID,{ memberID : 5 
            }, function(response){
                $('#CommentPosted'+getpID).append($(response).fadeIn('slow'));
                $("#commentMark-"+getpID).val("Write a comment...");                    
            });
        }
    });  
You need to URL-encode (with encodeURIComponent) comment_text, but why aren't you just sending that in the POST data?
Can't you do:
$.post("lib/actions/add_comment.php", {
    comment_text: comment_text,
    post_id: getpID,
    memberID: 5
}, function (response) { //etc.
?
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论