Skip to content

Instantly share code, notes, and snippets.

@tomschlick
Created November 13, 2009 03:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomschlick/233561 to your computer and use it in GitHub Desktop.
Save tomschlick/233561 to your computer and use it in GitHub Desktop.
checks to see if the current server request was made with AJAX , returns boolean TRUE or FALSE
function _is_ajax()
{
return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment