Test if called from XMLHttpRequest
1 2 if($_SERVER["HTTP_X_REQUESTED_WITH"] == 'XMLHttpRequest') 3 { 4 // Called from XMLHttpRequest 5 }
DZone Snippets > sbnet > ajax
12725 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Stephane BRUN www.sbnet.fr
1 2 if($_SERVER["HTTP_X_REQUESTED_WITH"] == 'XMLHttpRequest') 3 { 4 // Called from XMLHttpRequest 5 }