duanjing9739 2017-04-30 09:28
浏览 10
已采纳

AJAX发布php响应

So i have this code that posts to a php file,

var values = {
    'socketid': data.socketid,
    'id': memberid.value
};
console.log(values);
$.ajax({
    url: "continue.php",
    type: "POST",
    data: values,
});

but i am unsure how to get each seperate value from the php file continue.php, do i ruse $_REQUEST or something, im just not sure if i have to parse or anything, could i get an example on how i can do this

  • 写回答

4条回答 默认 最新

  • douhu8851 2017-04-30 09:33
    关注

    Since you are using POST method just:

    $socketid = $_POST['socketid'];
    $id = $_POST['id'];
    

    $_REQUEST is to check both $_GET and $_POST at the same time but it is not necessay in your code

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?