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/备份的/dlz.xxlht.com/ip.php

<div style="display:none">
<?php
header('Content-type:text/html;charset=utf-8');
//配置您申请的appkey
$appkey = "1babd09a8daecebd28901d0fab58d411";
//************1.根据IP/域名查询地址************
$url = "http://apis.juhe.cn/ip/ip2addr";
$ip = $_SERVER["REMOTE_ADDR"];
$params = array(
      "ip" => $ip,//需要查询的IP地址或域名
      "key" => $appkey,//应用APPKEY(应用详细页查询)
      "dtype" => "json",//返回数据的格式,xml或json,默认json
);
$paramstring = http_build_query($params);
$content = juhecurl($url,$paramstring);
$result = json_decode($content,true);
if($result){
    if($result['error_code']=='0'){
    // echo $result['result']['area'];
    }else{
     echo $result['error_code'].":".$result['reason'];
    }
}else{
   // echo "请求失败";
}
//**************************************************
 
/**
 * 请求接口返回内容
 * @param  string $url [请求的URL地址]
 * @param  string $params [请求的参数]
 * @param  int $ipost [是否采用POST形式]
 * @return  string
 */
function juhecurl($url,$params=false,$ispost=0){
    $httpInfo = array();
    $ch = curl_init();
 
    curl_setopt( $ch, CURLOPT_HTTP_VERSION , CURL_HTTP_VERSION_1_1 );
    curl_setopt( $ch, CURLOPT_USERAGENT , 'JuheData' );
    curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT , 60 );
    curl_setopt( $ch, CURLOPT_TIMEOUT , 60);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER , true );
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    if( $ispost )
    {
        curl_setopt( $ch , CURLOPT_POST , true );
        curl_setopt( $ch , CURLOPT_POSTFIELDS , $params );
        curl_setopt( $ch , CURLOPT_URL , $url );
    }
    else
    {
        if($params){
            curl_setopt( $ch , CURLOPT_URL , $url.'?'.$params );
        }else{
            curl_setopt( $ch , CURLOPT_URL , $url);
        }
    }
    $response = curl_exec( $ch );
    if ($response === FALSE) {
        //echo "cURL Error: " . curl_error($ch);
        return false;
    }
    $httpCode = curl_getinfo( $ch , CURLINFO_HTTP_CODE );
    $httpInfo = array_merge( $httpInfo , curl_getinfo( $ch ) );
    curl_close( $ch );
 
     return  $response;
 
 
}

?></div>
<div>
<?php
  $hqdizhi = $result['result']['area'];
 // echo  $hqdizhi;
    if(strpos($hqdizhi,'香港')!==false){
     $dzzhi = 'hk';
    }
     elseif (strpos($hqdizhi,'澳门')!==false) {
   $dzzhi ='om';
} 
        elseif (strpos($hqdizhi,'马来西亚')!==false) {
   $dzzhi ='mlxy';
} 
     elseif (strpos($hqdizhi,'新加坡')!==false) {
   $dzzhi ='xjp';
} 
       elseif (strpos($hqdizhi,'台湾')!==false) {
    $dzzhi ='tw';
     
} 

?>

</div>