i am using jquery at client end and use this code to send data

$.post(
        
    "ajax.php",
    
    { Name:'doodle', Fathers_name:'anything' }, 
    
        function(data){
        $('#display').html(data.returnValue);
    }, 
    
    "json"
    );

the thing is that php $_POST does not return anything nor does json_decode($_POST) but when i send data using the same function but instead of the second string i use
?Name=doodle&Fathers_name=anything
it works .
plz help as i want the first method to work.

Check with this code. What it alerts?

$.post("ajax.php", { Name:'doodle', Fathers_name:'anything' }, 
    function(data){
        alert(data);
    }
);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.