I'm creating an application with React, and the backend part with PHP
I have ajax request:
pesquisaCliente(e) {
e.preventDefault();
$.ajax({
url:'http://192.168.0.109/prontaentrega/pesquisaCliente.php',
contentType:'application/json',
datType:'json',
type:'post',
data:JSON.stringify({nome:this.state.nome}),
success: function(cli) {
}.bind(this)
});
}
and in the PHP part:
<?php
header('Access-Control-Allow-Origin: *');
header("Access-Control-Allow-Headers: Content-Type");
include 'conexao.php';
echo $_POST['nome'];
?>
But it does not show the $_POST['nome]'
value
Note: You are not giving any errors because they are different servers.