I have the following script
$(document).ready(function(){
$("#SoumettreCarte").submit(function(ev) {
alert('ok');
ev.preventDefault();
ville="bonjour";
$.post("../cartes/essai2.php", {ville:ville})
.done(function (response) {
// window.location.replace("http://localhost/projet2/cartes/essai2.php");
});
});
});
When i click on submit, i want it to redirect me to essai2.php, so i use window.location.replace
, but then i lose the value of my $_POST
. So my problem, is how to load another page after submitting a form with javascript without losing my $_POST
. Thanks for your help.
When i try action="essai2.php", i don't get "ville" in my $_POST.