A simple function to indicate whether a request was made via AJAX or not (
note: this is easily spoofed so it's not a secure method).
function isAjax()
{
return (isset($_SERVER['HTTP_X_REQUESTED_WITH'])
&& ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'));
}
No comments:
Post a Comment