我有一个这样的ajax调用--
$.ajax({
url: 'destination.php',
type: "put",
data: $('#myform').serialize(),
success: function (response) {
//some tasks
}
}
在我的destination.php文件中,如何处理put请求的表单值,并将这些值用于其他任务,比如将它们保存到数据库或文件中?我不是PHP/JQuery/Ajax .Thanks的专家。
发布于 2013-06-10 08:16:40
下面是一个如何处理put变量的示例:
parse_str(file_get_contents("php://input"),$putVars);
echo $putVars['name']; // input from your form
但是为什么你使用PUT而不是POST呢?
https://stackoverflow.com/questions/17018957
复制