//上传页面代码

  $url = "http://192.168.1.100/upload.php";  #可以get传相应参数
  $file = $path.'/'. $Icon; //要上传的文件
  $fields['f'] = '@'.$file;
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url );
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
  curl_setopt($ch, CURLOPT_POST, 1 );
  curl_setopt($ch, CURLOPT_POSTFIELDS, $fields );
  curl_exec( $ch );
  if ($error = curl_error($ch) ) {
    die($error);
  }
  curl_close($ch); 

    //接收图片资源

  date_default_timezone_set('Asia/Shanghai'); //设置时区
  $ip = '';
  if(getenv('HTTP_CLIENT_IP') && strcasecmp(getenv('HTTP_CLIENT_IP'), 'unknown')){
        $ip = getenv('HTTP_CLIENT_IP');
    }elseif(getenv('HTTP_X_FORWARDED_FOR') && strcasecmp(getenv('HTTP_X_FORWARDED_FOR'), 'unknown')){
        $ip = getenv('HTTP_X_FORWARDED_FOR');
    }elseif(getenv('REMOTE_ADDR') && strcasecmp(getenv('REMOTE_ADDR'), 'unknown')){
        $ip = getenv('REMOTE_ADDR');
    }elseif(isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], 'unknown')){
        $ip = $_SERVER['REMOTE_ADDR'];
    }
    preg_match("/[\d\.]{7,15}/", $ip, $ipmatches);
    $ip = $ipmatches[0] "[Y-m-d H:i:s]");
    $allowip = array('192.168.1.100');
    if(!in_array($ip,$allowip)){
        $ipVal = "{$date}{$ip}\n";
        file_put_contents('upload_ip.log', $ipVal, FILE_APPEN);
        die(-1);
    }

    //接收get传参
    $lang = isset($_REQUEST['lang']) "/data/cdncache/res/gifts/{$lang}/";
    $uploadfile = $uploaddir . $_FILES['f']['name'];
    if (move_uploaded_file($_FILES['f']['tmp_name'], $uploadfile)) #保存图片成功
    {
        $type = $_FILES['f']['type'];
        $tmp_name = $_FILES['f']['tmp_name'];
        $error = $_FILES['f']['error'];
        $size = $_FILES['f']['size'];
        $log_txt = ' name:' . $_FILES['f']['name'] . ' type:' . $type . ' tmp_name:' . $tmp_name . ' error:' . $error . ' size:' . $size . " hello " . ' lang:' . $_REQUEST['lang'];
        $value = "{$date}{$log_txt}\n";
        @file_put_contents('upload_ok.log', $value, FILE_APPEND);
        exit();
    } else {
        $type = $_FILES['f']['type'];
        $tmp_name = $_FILES['f']['tmp_name'];
        $error = $_FILES['f']['error'];
        $size = $_FILES['f']['size'];
        $log_txt = ' name:' . $_FILES['f']['name'] . ' type:' . $type . ' tmp_name:' . $tmp_name . ' error:' . $error . ' size:' . $size . " hello " . ' lang:' . $_REQUEST['lang'];
        $value = "{$date}{$log_txt}\n";
        @file_put_contents('upload_ng.log', $value, FILE_APPEND);
        exit();
  }

以上所述就是本文的全部内容了,希望大家能够喜欢。

华山资源网 Design By www.eoogi.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
华山资源网 Design By www.eoogi.com

RTX 5090要首发 性能要翻倍!三星展示GDDR7显存

三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。

首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。

据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。