Home >Backend Development >PHP Tutorial >PHP code to detect ajax requests

PHP code to detect ajax requests

WBOY
WBOYOriginal
2016-07-25 09:03:13779browse
Most JavaScript frameworks, such as jquery, Mootools, etc., will send additional HTTP_X_REQUESTED_WITH header information when making Ajax requests. The headers treat them as an ajax request, so the Ajax request can be detected on the server side.

Most JavaScript frameworks, such as jquery, Mootools, etc., will send additional HTTP_X_REQUESTED_WITH header information when making Ajax requests, treating them as an ajax request, so Ajax requests can be detected on the server side. Here is a piece of php code for detecting ajax requests.



Statement:
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