Professional Website Development using HTML5, CSS3, Responsive design, WordPress, Drupal, Symfony2, custom PHP programming / mySQL and more!

Author: Mohamed Tair

Detect if is an AJAX request – PHP function

To check Ajax Request in PHP, we will verify the value of HTTP_X_REQUESTED_WITH server header , if has been set, if there is a response, the result is"TRUE" otherwise "FALSE" that means it will returns a boolean response. This simple php function return true, if request to server is AJAX request. function is_ajax() { return (isset($_SERVER['HTTP_X_REQUESTED_WITH'])...