I have this code plus ajax does not have a value
$.ajax({
url: 'php/vizCliente.class.php',
type: 'POST',
data: {
update: '1'
},
cache: false,
datatype: "json",
error: function(e) {
alert('Erro ao tentar ação! \n'+e);
},
success: function(data) {
alert(data);
},
});
});
This is the code in php
final class vizCliente
{
public $update;
public function __construct()
{
$this->update = $_POST['update'];
if($this->update == '1')
{
echo $this->update;
}
}
}