Is there a way to send a PHP command via Ajax?
For example:
$.ajax({
url: 'index.php',
type: 'POST',
data: '<?php echo "teste"; ?>',
success: function(r) {
$('body').html(r);
}
});
In the case, I'm still studying Ajax, I did not quite understand, I did this example code, but for example, what does it do?
Does it send what it has in data:
to url index.php or does it get content from index.php?
If the answer is second, then what is the date in ajax?