Skip to content

Instantly share code, notes, and snippets.

@dwolfhub
Created August 22, 2013 16:16
Show Gist options
  • Save dwolfhub/6309392 to your computer and use it in GitHub Desktop.
Save dwolfhub/6309392 to your computer and use it in GitHub Desktop.
PHP: Detect AJAX
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) AND strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest') {
// I'm AJAX!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment