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

php虾囧cms笑话程序

来源:互联网 收集:自由互联 发布时间:2021-06-28
function getIp() { if ($HTTP_SERVER_VARS ["HTTP_X_FORWARDED_FOR"]) { $ip = $HTTP_SERVER_VARS ["HTTP_X_FORWARDED_FOR"]; } elseif ($HTTP_SERVER_VARS ["HTTP_CLIENT_IP"]) { $ip = $HTTP_SERVER_VARS ["HTTP_CLIENT_IP"]; } elseif ($HTTP_SERVER_VARS
 
function getIp() {
    if ($HTTP_SERVER_VARS ["HTTP_X_FORWARDED_FOR"]) {
        $ip = $HTTP_SERVER_VARS ["HTTP_X_FORWARDED_FOR"];
    } elseif ($HTTP_SERVER_VARS ["HTTP_CLIENT_IP"]) {
        $ip = $HTTP_SERVER_VARS ["HTTP_CLIENT_IP"];
    } elseif ($HTTP_SERVER_VARS ["REMOTE_ADDR"]) {
        $ip = $HTTP_SERVER_VARS ["REMOTE_ADDR"];
    } elseif (getenv ( "HTTP_X_FORWARDED_FOR" )) {
        $ip = getenv ( "HTTP_X_FORWARDED_FOR" );
    } elseif (getenv ( "HTTP_CLIENT_IP" )) {
        $ip = getenv ( "HTTP_CLIENT_IP" );
    } elseif (getenv ( "REMOTE_ADDR" )) {
        $ip = getenv ( "REMOTE_ADDR" );
    } else {
        $ip = "0.0.0.0";
    }
    return $ip;
}

网友评论