javascript - How to handle json data, which I send via ajax request, in php script? -
javascript - How to handle json data, which I send via ajax request, in php script? -
i sending json info ajax:
function send() { $.ajax({ url: '/index.php?action=setshopordersgoods&order_id='+orderid, type: 'post', datatype: 'json', success: function (data) { $('#target').html(data.msg); }, data: json.stringify(goods) }); }
there no problems it. firebug console screen:
soajax request sending okay. need handle it.
how can this?
echo __file__; echo '<pre>'; var_dump($_post); echo '</pre>'; exit;
this code shows nothing. looks there no info send via post. firebug response tab of sent ajax request:
how can handle json info in php file then?
json info not receive in post.
$json = file_get_contents('php://input'); $post = json_decode($json, true); echo __file__; echo '<pre>'; var_dump($post); echo '</pre>'; exit;
javascript php ajax json
Comments
Post a Comment