<?php
if($_SERVER['HTTP_APPVERSION']){
include "../saesiteinfo.php";
 }else{
include "../siteinfo.php";
 }
include '../function.php';
ignore_user_abort(true);
//date_default_timezone_set("Asia/Shanghai");
//$time=date("H");//获取当前时间
$localhost=mysql_connect($sqlhost,$sqluser,$sqlpass)or die('无法连接服务器');
mysql_select_db($sqldata,$localhost);
mysql_query("SELECT COUNT(id) FROM qqlist ");
$result=mysql_query("SELECT * FROM qqlist ");
//if ($time=="12" or $time=="23"){
//判断是否到了执行时间
while($row=mysql_fetch_array($result)){
//开始
$out=newsid($row['qq'],$row['pw']);
if(preg_match("/操作异常/i",$out)){

mysql_query("UPDATE qqlist SET newsid='no' WHERE qid='".$row['qid']."'");
echo ' 更新失败';

}elseif(preg_match("/成功/i",$out)){

$outt=explode('sid=',$out);
$sid=substr($outt[1],0,24);
mysql_query("UPDATE qqlist SET sid='$sid',newsid='yes' WHERE qid='".$row['qid']."'");
mysql_query("UPDATE ".$row['fwq']." SET sid='$sid' WHERE qid='".$row['qid']."'");
echo ' 更新成功';

}
//结束 
//	   }

}
?>