<?php
error_reporting(0); 
$lurl='http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
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;
}
$biaoshi=ubo($_GET['biaoshi']);
$type="where biaoshi='$biaoshi'";
$lishi=queryall(lishi,$type);
$urllist=$lishi[url];
$userid=$lishi[userid];
$type="where userid='$userid'";
$wangzhan=queryall(wangzhan,$type);
if(!$lishi){echo err();}
$type="where userid='$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);
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.'/hezimoban-daili-'.$biaoshi.'-'.$user[hzmb].'.html';  
header ("location:$link");
?>
