Archive of published articles on August, 2006

Back home

Recognize Ajax Request (XMLHttpRequest)

28/08/2006

To recognize Ajax Request (Prototype/JQuery) in PHP you can use following code:

function xhr() {
 return isset($_SERVER['HTTP_X_REQUESTED_WITH']) &&
 $_SERVER ['HTTP_X_REQUESTED_WITH']  == 'XMLHttpRequest';
}
No Comments