Home > Backend Development > PHP Tutorial > PHP checks whether it is an ajax request method, PHP checks ajax request_PHP tutorial

PHP checks whether it is an ajax request method, PHP checks ajax request_PHP tutorial

WBOY
Release: 2016-07-13 09:56:49
Original
809 people have browsed it

php method to check whether it is an ajax request, php to check whether it is an ajax request

The example in this article describes the method of php checking whether it is an ajax request. Share it with everyone for your reference. The details are as follows:

Through this code, you can determine whether the user's request comes from AJAX XMLHttpRequest to distinguish between ordinary post, get and ajax

function isAjax() {
return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) &&
($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'));
}
Copy after login

I hope this article will be helpful to everyone’s PHP programming design.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/985280.htmlTechArticlephp method to check whether it is an ajax request, php check whether it is an ajax request. The example in this article tells about php checking whether it is an ajax request. method. Share it with everyone for your reference. The details are as follows: Through this paragraph...
Related labels:
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