Home > php教程 > php手册 > php 判断是否是ajax请求

php 判断是否是ajax请求

WBOY
Release: 2016-06-06 19:33:20
Original
1560 people have browsed it

无详细内容 无 function isAjax() { if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) ) { if('xmlhttprequest' == strtolower($_SERVER['HTTP_X_REQUESTED_WITH'])) return true; } //如果参数传递的参数中有ajax if(!empty($_POST['ajax']) || !empty($_GET['a

function isAjax() {
        if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) ) {
            if('xmlhttprequest' == strtolower($_SERVER['HTTP_X_REQUESTED_WITH']))
                return true;
        }
        //如果参数传递的参数中有ajax
        if(!empty($_POST['ajax']) || !empty($_GET['ajax']))
            return true;
        return false;
}
Copy after login
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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template