I am trying to do an AJAX request using jQuery using the following code:
$.ajax({
type: 'POST',
url: './ajax/mostra_duv.php',
data: 'pag=1&teste=deu',
cache: false,
contentType: false,
processData: false
})
.done(function(data) {
if(data!='')
{
$("#resumoduvida").html(data);
}
else
{
$("#resumoduvida").html('<p>Desculpe, houve um problema na conexão ao servidor. Tente novamente</p>');
}
})
.fail(function() {
$("#resumoduvida").html('<p>Desculpe, houve um problema na conexão ao servidor. Tente novamente</p>');
});
Then, the mostra_duv.php is just calling print_r($_POST);
resulting in an empty array...
I would expect to get $_POST['pag']
and $_POST['teste']
with values corresponding to the request (respectively 1 and 'deu').
Any help is appreciated! Thanks!