使用这个jquery:
$.ajax({
type: "POST",
url: "tosql.php",
data: {
content: content
},
success: function() {
}
});我想知道我是否可以从php接收一个标题(location:),以重定向到url中存储了特定值的另一个页面。下面是url:header(location: 'morefive.php?document='.urlencode($id))
发布于 2011-08-07 07:18:36
假设tosql.php返回id,您可以这样做:
$.ajax({
type: "POST",
url: "tosql.php",
data: {
content: content
},
success: function(data){
window.location = 'morefive.php?id=' + data;
}
});更新:
在tosql.php上:
$_POST['content'];
// do something with content
echo $id; //say $id = 123如果成功,您将被定向到morefive.php?id=123。
https://stackoverflow.com/questions/6969612
复制相似问题