当前位置 : 主页 > 网络编程 > PHP >

判断用户是否使用代理的PHP代码

来源:互联网 收集:自由互联 发布时间:2021-06-30
?php/******************************************************* isProxy* check whether client is under Proxy or not* $_SERVER['HTTP_X_FORWARDED_FOR'] is pivotal here* if client is under Proxy, returns true* if client is not under Proxy, return
 <?php
/*****************************************************
*
*    isProxy
*    check whether client is under Proxy or not
*    $_SERVER['HTTP_X_FORWARDED_FOR'] is pivotal here
*    if client is under Proxy, returns true
*    if client is not under Proxy, returns false
*    
*****************************************************/

function isProxy(){
    return (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) ? true : false;
}
?> 
网友评论