I am trying to pass json with ajax, the call is goin okay. I can see the data at the Request Payload section but not in post variable.
var p = {
c: c,
g: g,
t: t
};
var myJSON= JSON.stringify(p);
$.ajax({
url: "addedit.php",
type: 'POST',
dataType: 'json',
contentType: 'application/json',
data: myJSON,
success: function () {
alert("success");
}
});
PHP code :
$myjson= array();
$myjson= json_decode($_POST['myJSON']);
var_dump($myjson);die;