1
I’m having trouble getting the id passed by the ajax date (jquery), what happens is using $_POST['id']
or filter_input(INPUT_POST,'id')
empty
follow the ajax:
$.ajax({
type:"POST",
url: "cursos/area/",
dataType:'JSON',
data:JSON.stringify ({'id': idArea}),
contentType: "application/json; charset=utf-8",
success: function (result) {
console.debug(result);
}
})
and in PHP I’m simply trying to display to test
var_dump($_POST['id'])
I tried to find other ways to pass the date, because I believe to be the problem, but nothing worked.
NOTE: no Request Payload id is right
Pq is using this way:
data:JSON.stringify ({'id': idArea}),
when you could use it like this:data: {id: idArea},
?– Sam
@Sam actually I was testing several ways, it turned out that when I asked the question was sssim
– Otavio Souza Rocha