<?php
error_reporting(0); 
include("config/conn.php");
include("config/common.php");
$hyurl='http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$sql = "WHERE 1=1";
$sql .=" and zt='正常'";
$sql .=" and qx='1'";
$sql .=" and cs>0";
$resul= mysql_query("select id from zurl   ".$sql."  ");
$count = mysql_num_rows($resul); 
echo '当前共有正常域名 【'.$count.'】条';
$query = mysql_query("select * from  zurl  ".$sql."");
while ($a=mysql_fetch_array($query)) { 
$res=json_decode(file_get_contents("http://yy.gongju.at/?a=addon&m=wxdwz&token=fe10ece7e8bfdcb0ccc7ee9254830b12&long=".urlencode($a[url])),1);
if($res['state']==1){
$type=" id='$a[id]'";
dbdel(zurl,$type);
echo "<script>location.href='$hyurl'</script>";
exit;
}
}
?>
