public function scan() { scanUrl($this->attributes['url']); }
function runScanWebUrl() { $nSetTime = ''; $setCharSet = ''; $httpUrl = ''; $url = ''; $selectWeb = ''; $nThis = ''; $nCount = ''; $startTime = ''; $setCharSet = 'gb2312'; //gb2312 //http://www.dfz9.com/ //http://www.maiside.net/ //http://sharembweb.com/ //http://www.ufoer.com/ $httpUrl = 'http://sharembweb.com/'; //selectWeb="ufoer" if ($selectWeb == 'ufoer') { $httpUrl = 'http://www.ufoer.com/'; $setCharSet = 'utf-8'; } $nThis = @$_REQUEST['nThis']; if ($nThis == '') { $nThis = 0; } else { $nThis = cint($nThis); } $GLOBALS['conn='] = OpenConn(); $rsObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'weburlscan'); $nCount = @$_REQUEST['nCount']; if ($nCount == '') { $nCount = @mysql_num_rows($rsObj); } if (@mysql_num_rows($rsObj) == 0) { connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'weburlscan(httpurl,title,isthrough,charset) values(\'' . $httpUrl . '\',\'home\',true,\'' . $setCharSet . '\')'); } //循环 $rsxObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'weburlscan where isThrough=true'); if (@mysql_num_rows($rsxObj) != 0) { $rsx = mysql_fetch_array($rsxObj); $nThis = $nThis + 1; aspEcho($nThis, $rsx['httpurl']); doEvents(); $nSetTime = scanUrl($rsx['httpurl'], $rsx['title'], $rsx['charset']); //这样写是给转PHP时方便 connexecute('update ' . $GLOBALS['db_PREFIX'] . 'weburlscan set isthrough=false where id=' . $rsx['id'] . ''); $startTime = @$_REQUEST['startTime']; if ($startTime == '') { $startTime = now(); } VBRunTimer($startTime); $url = getUrlAddToParam(getThisUrl(), '?nThis=' . $nThis . '&nCount=' . $nCount . '&startTime=' . $startTime . '&N=' . getRnd(11), 'replace'); Rw(jsTiming($url, $nSetTime)); die; } aspEcho('操作完成', '<a href=\'?act=dispalyManageHandle&actionType=WebUrlScan&addsql=order by id desc&lableTitle=网址扫描\'>OK,共(' . $nThis . ')条</a>'); //输入报告 $rsObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'weburlscan where webstate=404'); while ($rs = $GLOBALS['conn']->fetch_array($rsObj)) { aspEcho('<a href=\'' . $rs['httpurl'] . '\' target=\'_blank\'>' . $rs['httpurl'] . '</a>', '<a href=\'' . $rs['tohttpurl'] . '\' target=\'_blank\'>' . $rs['tohttpurl'] . '</a>'); } }