这是代码。它是我创建的wordpress页面。两个页面都在同一个文件夹中。我将数据从leadgen.php发送到page-success.php
jQuery.ajax({
url: "http://localhost/success-page",
type: "POST",
data: 'name=' +name+'&email='+email+'&phone='+phone+'&content='+'&city='city+'&date='+date+'&event_type='+event_type+'&service='+service+'&guests='+guests+'&budget='+budget+'&locality='+locality+'&food_type='+food_type+'&venue_type='+venue_type+'&photography_type='+photography_type;
success:function(data){
document.location.href = 'http://localhost/success-page/';
},
error:function (){}
});
});
答案 0 :(得分:0)
发布这样的数据,不要使用查询字符串。
jQuery.ajax({
url: "http://localhost/success-page",
type: "POST",
data: {
Name: name,
Email: email
// more data you want to post....
},
success:function(data){
document.location.href = 'http://localhost/success-page/';
},
error:function (){}
});
答案 1 :(得分:0)
Allow