function handleXmlGet($httpurl, $codeset = '') { //toGB2312Char(content) return array(get_url_content($httpurl), getHttpUrlState($httpurl)); }
function scanDomainHomePage() { $url = ''; $nSetTime = ''; $isdomain = ''; $htmlDir = ''; $txtFilePath = ''; $homePageList = ''; $nThis = ''; $nCount = ''; $splstr = ''; $s = ''; $c = ''; $website = ''; $nState = ''; $isAsp = ''; $isAspx = ''; $isPhp = ''; $isJsp = ''; $c2 = ''; $isAsp = 0; $isAspx = 0; $isPhp = 0; $isJsp = 0; $nThis = @$_REQUEST['nThis']; if ($nThis == '') { $nThis = 0; } else { $nThis = cint($nThis); } $nSetTime = 3; $GLOBALS['conn='] = OpenConn(); $rsObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'webdomain where website<>\'\' and homepagelist=\'\' and isdomain=true'); $nCount = @$_REQUEST['nCount']; if ($nCount == '') { $nCount = @mysql_num_rows($rsObj); } while ($rs = $GLOBALS['conn']->fetch_array($rsObj)) { $nThis = $nThis + 1; aspEcho($nThis . '/' . $nCount, $rs['website']); doEvents(); $htmlDir = '/../网站UrlScan/域名首页/'; CreateDirFolder($htmlDir); $txtFilePath = $htmlDir . '/' . setFileName($rs['website']) . '.txt'; if (CheckFile($txtFilePath) == true) { $c = PHPTrim(getFText($txtFilePath)); $isAsp = getStrCut($c, 'isAsp=', vbCrlf(), 1); $isAspx = getStrCut($c, 'isAspx=', vbCrlf(), 1); $isPhp = getStrCut($c, 'isPhp=', vbCrlf(), 1); $isJsp = getStrCut($c, 'isJsp=', vbCrlf(), 1); aspEcho('类型', '本地'); $nSetTime = 1; } else { $website = getWebSite($rs['website']); if ($website == '') { Eerr('域名为空', $GLOBALS['httpurl']); } $splstr = array('index.asp', 'index.aspx', 'index.php', 'index.jsp', 'index.htm', 'index.html', 'default.asp', 'default.aspx', 'default.jsp', 'default.htm', 'default.html'); $c2 = ''; $homePageList = ''; foreach ($splstr as $key => $s) { $url = $website . $s; $nState = getHttpUrlState($url); aspEcho($url, $nState . ' (' . getHttpUrlStateAbout($nState) . ')'); doEvents(); if (($s == 'index.asp' || $s == 'default.asp') && ($nState == '200' || $nState == '302')) { $isAsp = 1; } else { if (($s == 'index.aspx' || $s == 'default.aspx') && ($nState == '200' || $nState == '302')) { $isAspx = 1; } else { if (($s == 'index.php' || $s == 'default.php') && ($nState == '200' || $nState == '302')) { $isPhp = 1; } else { if (($s == 'index.jsp' || $s == 'default.jsp') && ($nState == '200' || $nState == '302')) { $isJsp = 1; } } } } if ($nState == '200' || $nState == '302') { $homePageList = $homePageList . $s . '|'; } $c2 = $c2 . $s . '=' . $nState . vbCrlf(); } $c = 'isAsp=' . $isAsp . vbCrlf(); $c = $c . 'isAspx=' . $isAspx . vbCrlf(); $c = $c . 'isPhp=' . $isPhp . vbCrlf(); $c = $c . 'isJsp=' . $isJsp . vbCrlf() . $c2; if ($homePageList == '') { $homePageList = '无'; } createFile($txtFilePath, $c); aspEcho('类型', '网络'); } //这样写是给转PHP时方便 connexecute('update ' . $GLOBALS['db_PREFIX'] . 'webdomain set isasp=' . $isAsp . ',isaspx=' . $isAspx . ',isphp=' . $isPhp . ',isjsp=' . $isJsp . ',isthrough=false,homepagelist=\'' . $homePageList . '\',updatetime=\'' . now() . '\' where id=' . $rs['id'] . ''); $GLOBALS['startTime'] = @$_REQUEST['startTime']; if ($GLOBALS['startTime'] == '') { $GLOBALS['startTime'] = now(); } Rw(VBRunTimer($GLOBALS['startTime']) . '<hr>'); $url = getUrlAddToParam(getThisUrl(), '?nThis=' . $nThis . '&nCount=' . $nCount . '&startTime=' . $GLOBALS['startTime'] . '&N=' . getRnd(11), 'replace'); Rw(jsTiming($url, $nSetTime)); die; } aspEcho('操作完成', '<a href=\'?act=dispalyManageHandle&actionType=WebDomain&addsql=order by id desc&lableTitle=网站域名\'>OK,共(' . $nThis . ')条</a>'); }