I'm calling a file via jQuery's AJAX method looks like this:
$is_ajax = $_REQUEST['is_ajax'];
if(isset($is_ajax) && $is_ajax)
{
echo 'its ajax!';
}
else echo 'im called, but not via ajax';
and my AJAX call:
jQuery.ajax({
type: 'POST',
url: 'my-service.php',
data: data,
success: function(response) {
alert(response);
}
});
But alert always shows 'not ajax' message. What am I doing wrong?