I passed these values via ajax:
$.ajax({
url: '/loterias/cadastro.php',
type: "POST",
data: "{'numeros': '" + numeros + "', 'jogo':'" + jogo + "'}",
dataType: 'application/json; charset=utf-8',
success: function (data) {
debugger;
alert(data);
},
error: function(xhr,err){
alert("readyState: "+xhr.readyState+"\nstatus: "+xhr.status);
alert("responseText: "+xhr.responseText);
}
});
In PHP (cadastre.php) I received this way (I do not know if it's correct):
$data = json_decode(file_get_contents('php://input'), TRUE);
How can I echo the "numbers" and "game" values?