$('.addFormForm').submit(function(){
//requête ajax permettant l'envoie de formulaire au controleur
$.ajax({
type : "POST",
//chargement du controleur
url : 'gestionForm.php',
//passage des données au controler
data : {dataJson: test123},
dataType: "json",
success: function(response) {
console.log(response);
}
})
});
Hi, here is my ajax request where I send a json structure : "test123" to the page : gestionForm, There is gestionForm :
$data = $_POST["dataJson"];
if(isset($_POST['submitForm'])){
$obj = new Form($_POST['nomForm'], $data);
$obj->getIDPage($_POST['nomPage']);
$obj->addForm();
}
And I get the error :
Undefined array key "dataJson"
Can someone help me pls?