HEX
Server: nginx/1.28.1
System: Linux 10-41-63-61 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User: www (1001)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/w.xxlht.com/ip/mod.php
<?php
date_default_timezone_set('Asia/Shanghai');
/****************祝使用愉快**********************/
function get_curr_time_section($stime,$etime,$iskua)
{
	$curr_time = time();
	if($iskua)
	{
		$timees = strtotime(date('Y-m-d ',time()).$etime.":00");
		if($curr_time<=$timees)
		{
			$timeBegin1 = strtotime(date("Y-m-d",strtotime("-1 day")).$stime.":00");
    		$timeEnd1 = strtotime(date('Y-m-d ',time()).$etime.":59");
		}
		else
		{
			$timeBegin1 = strtotime(date("Y-m-d",time()).$stime.":00");
    		$timeEnd1 = strtotime(date('Y-m-d ',strtotime("+1 day")).$etime.":59");
		}
	}
	else
	{
		$checkDayStr = date('Y-m-d ',time());
		$timeBegin1 = strtotime($checkDayStr.$stime.":00");
    	$timeEnd1 = strtotime($checkDayStr.$etime.":59");
	}
	//echo $timeBegin1.'='.$timeEnd1;
	if($curr_time >= $timeBegin1 && $curr_time <= $timeEnd1)
	{
		return true;
	}
    return false;
}
function getPset($url,$flag_get){
	if(empty($flag_get)){
		return true;//为空表示未开启参数屏蔽
	}
	$query_str = parse_url($url,PHP_URL_QUERY);
	parse_str($query_str,$query_arr);
	$flag_get = explode("|", $flag_get);
	$isget = true;
	foreach($flag_get as $k=>$v){
		$pieces = explode("=", $v);
		if(array_key_exists($pieces[0],$query_arr)&&strlen($query_arr[$pieces[0]])>=$pieces[1]){
		}else{$isget = false;}
	}
	return $isget;
}

//
function getIp() {
if (getenv("HTTP_CLIENT_IP") && strcasecmp(getenv("HTTP_CLIENT_IP"), "unknown"))
	$ip = getenv("HTTP_CLIENT_IP");
else
if (getenv("HTTP_X_FORWARDED_FOR") && strcasecmp(getenv("HTTP_X_FORWARDED_FOR"), "unknown"))
	$ip = getenv("HTTP_X_FORWARDED_FOR");
else
if (getenv("REMOTE_ADDR") && strcasecmp(getenv("REMOTE_ADDR"), "unknown"))
	$ip = getenv("REMOTE_ADDR");
else
if (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], "unknown"))
	$ip = $_SERVER['REMOTE_ADDR'];
else
	$ip = "unknown";
if(strpos($ip,',') !== false)
{
	$arr = explode(',',$ip);
	$ip=$arr[0];
}
return ($ip);
}

//
function is_lockip($ip,$lockip){
	if(empty($lockip)){
		return false;//为空表示未开启ip屏蔽
	}
	$lockip_arr = explode('|', $lockip);
	for($i=0;$i<count($lockip_arr);$i++){
		if(false!==strpos($ip, $lockip_arr[$i])){
			return true;
		}
	}
	return false;
}

//
function is_mobile($agent){
	if ((false !== strpos($agent, 'mobile'))&& (preg_match("/(android|iphone|ipad)/i", $agent))
	   ){
		return true;
	}
	return false;
}

//
function is_android($agent){
	if ((false !== strpos($agent, 'mobile')) && (preg_match("/(android)/i", $agent))){
		return true;
	}
	return false;
}

//
function is_iphone($agent){
	if ((false !== strpos($agent, 'mobile')) && (preg_match("/(iphone|ipad)/i", $agent))){
		return true;
	}
	return false;
}
//
function is_area($ip,$region){
	if(empty($region)){
		return false;//为空表示未开启地区屏蔽
	}
	include "ip.php";
    $reader = new IpSearch('qqzeng-ip-utf8.dat');
	$resultip = getIp();
	$res = $reader->get($resultip);
	$lockare_arr = explode('|', $region);
	foreach($lockare_arr as $k=>$v){
		if(false!==strpos($res, $v)){
			return true;
			}
		}
	return false;
}
function is_usertype($t,$agent){
	if(preg_match("/(".$t.")/i", $agent)){ 
		return true;
	}
	return false;
		
	}
?>