Home > Backend Development > PHP Tutorial > Check if ajax request is made in php

Check if ajax request is made in php

巴扎黑
Release: 2016-11-22 16:08:15
Original
1141 people have browsed it


$ajax = false;


if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) 

&& strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') 

{

  $ajax = true;

}


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template