<?php
error_reporting(0); 
include("../config/wap.php");
$ip= getIP();
$type="WHERE ip='$ip'";
$ts=queryall(ts,$type);
if($ts[zt]=='禁止访问'){
$content2 ="<script>location.href='/tserr$dshz'</script>";
echo $content2;
exit;
}
$id=base64_decode(ubo($_GET[id]));
$type="where id='$id'";
$daili=queryall(daili,$type);
if(!$daili){echo err();}
$type="where userid='$daili[userid]'";
$user=queryall(user,$type);
if($user[pb]==1 or $user==null){
$str ="<script>location.href='http://www.baidu.com'</script>";
echo $str;
exit;
}
$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);
if($ymjc==1){
$jczt=ubourljc($tzurl);
if($jczt==0){
$type="zt='拦截'  where url='$tzurl' ";
upalldt(zurl,$type);
echo "<script>location.href='$lurl'</script>";
exit;
}
}
$link='http://'. random(20).'.'. $tzurl.'/tzzonglink-'.$_GET[id].'-'.$user[mb].$dshz.'?form='.$user[mb];  
header ("location:$link");
?>
