2
Well, I’m sending a json to php but I can’t recover
$.ajax({
type: "POST",
url: "sys/salvar_servidor",
datType: 'json',
data: JSON.stringify(dados),
success: function( data ){
document.write(data);
}
});
And in PHP
<?php
$dados = $_REQUEST['dados'];
$obj = json_decode($dados);
echo $obj->nome;
?>
The problem is that PHP gives me an error stating that the data variable is not defined.
It worked! Thank you. Could you tell me what was going on?
– Mike