Q:

$_POST does not work does not give data passed from ajax

HI i want simple pass object using ajax to other php page but when trying retrieve its does not fine. Give me Undefined error. check my code to get clarification.
See my error screen shot :

Edit.php 

$('#regForm').on('submit', function (e)
{
    var serialData = $(this).serialize(), 
        s = location.search.split('='), 
        searchId = s[s.length-1];

    console.log(serialData);
    console.log(searchId);

    $.ajax({
        method:'POST', 
        url:'update.php',
        dataType:'json', 
        data:{data:serialData, id:searchId},
        success:function(jsonObj){
            console.log(jsonObj);
        }
    });
});

update.php 

<?php 
    if(isset($_POST['submit'])){
        var_dump($_POST['data']);
        var_dump($_POST['id']);

        exit();

        $phpObj = json_decode($_POST['data']);
        echo json_encode($phpObj);
    } 
?>

A:

problem is in your ajax call
$.ajax({
          method:'POST', 
          url:'update.php',
          dataType:'json', 
          data:{data:serialData, id:searchId},
          success:function(jsonObj){
              console.log(jsonObj);
          }
      });

its should be type:'POST' not a method.
that's why your data not getting by PHP file there.
Your PHP code is ok.

