Here is the code. It is wordpress pages that I created.Both pages are in same folder. I am sending data from leadgen.php to 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 (){}
});
});
Post you data like this, do not use query string.
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 (){}
});
you are not concatenating query string in the correct format.
Please try below code.
jQuery.ajax({
url: "http://localhost/success-page",
type: "POST",
data: 'name=' +name+'&email='+email+'&phone='+phone+'&content='+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 (){}
});
});
I hope this will helps you