Return to Snippet

Revision: 46584
at May 22, 2011 20:48 by nveselinov


Initial Code
<?php
define('IS_AJAX', isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');

if(IS_AJAX)
{
    echo 'Ajax request was here';
}
else
{
    echo 'Not ajax request';
}
?>

Initial URL

                                

Initial Description

                                

Initial Title
How to check whether ajax request

Initial Tags

                                

Initial Language
PHP