function webStat($folderPath) { $dateTime = ''; $content = ''; $splStr = ''; $thisUrl = ''; $goToUrl = ''; $caiShu = ''; $c = ''; $fileName = ''; $co = ''; $ie = ''; $xp = ''; $goToUrl = serverVariables('HTTP_REFERER'); $thisUrl = 'http://' . serverVariables('HTTP_HOST') . serverVariables('SCRIPT_NAME'); $caiShu = serverVariables('QUERY_STRING'); if ($caiShu != '') { $thisUrl = $thisUrl . '?' . $caiShu; } $goToUrl = @$_REQUEST['GoToUrl']; $thisUrl = @$_REQUEST['ThisUrl']; $co = @$_GET['co']; $dateTime = now(); $content = serverVariables('HTTP_USER_AGENT'); $content = replace($content, 'MSIE', 'Internet Explorer'); $content = replace($content, 'NT 5.0', '2000'); $content = replace($content, 'NT 5.1', 'XP'); $content = replace($content, 'NT 5.2', '2003'); $splStr = aspSplit($content . ';;;;', ';'); $ie = $splStr[1]; $xp = aspTrim($splStr[2]); if (right($xp, 1) == ')') { $xp = mid($xp, 1, len($xp) - 1); } $c = '来访' . $goToUrl . vbCrlf(); $c = $c . '当前:' . $thisUrl . vbCrlf(); $c = $c . '时间:' . $dateTime . vbCrlf(); $c = $c . 'IP:' . getIP() . vbCrlf(); $c = $c . 'IE:' . getBrType('') . vbCrlf(); $c = $c . 'Cookies=' . $co . vbCrlf(); $c = $c . 'XP=' . $xp . vbCrlf(); $c = $c . 'Screen=' . @$_REQUEST['screen'] . vbCrlf(); //屏幕分辨率 $c = $c . '用户信息=' . serverVariables('HTTP_USER_AGENT') . vbCrlf(); //用户信息 $c = $c . '-------------------------------------------------' . vbCrlf(); //c=c & "CaiShu=" & CaiShu & vbcrlf $fileName = $folderPath . Format_Time(now(), 2) . '.txt'; CreateAddFile($fileName, $c); $c = $c . vbCrlf() . $fileName; $c = replace($c, vbCrlf(), '\\n'); $c = replace($c, '"', '\\"'); //Response.Write("eval(""var MyWebStat=\""" & C & "\"""")") $splxx = ''; $nIP = ''; $nPV = ''; $ipList = ''; $s = ''; $ip = ''; //判断是否显示回显记录 if (@$_REQUEST['stype'] == 'display') { $content = getFText($fileName); $splxx = aspSplit($content, vbCrlf() . '-------------------------------------------------' . vbCrlf()); $nIP = 0; $nPV = 0; $ipList = ''; foreach ($splxx as $key => $s) { if (inStr($s, '当前:') > 0) { $s = vbCrlf() . $s . vbCrlf(); $ip = ADSql(getStrCut($s, vbCrlf() . 'IP:', vbCrlf(), 0)); $nPV = $nPV + 1; if (inStr(vbCrlf() . $ipList . vbCrlf(), vbCrlf() . $ip . vbCrlf()) == false) { $ipList = $ipList . $ip . vbCrlf(); $nIP = $nIP + 1; } } } Rw('document.write(\'网长统计 | 今日IP[' . $nIP . '] | 今日PV[' . $nPV . '] \')'); } $webStat = $c; return @$webStat; }
function whiteWebStat($content) { $splStr = ''; $splxx = ''; $filePath = ''; $nCount = ''; $url = ''; $s = ''; $visitUrl = ''; $viewUrl = ''; $viewdatetime = ''; $ip = ''; $browser = ''; $operatingsystem = ''; $cookie = ''; $screenwh = ''; $moreInfo = ''; $ipList = ''; $dateClass = ''; $splxx = aspSplit($content, vbCrlf() . '-------------------------------------------------' . vbCrlf()); $nCount = 0; foreach ($splxx as $key => $s) { if (inStr($s, '当前:') > 0) { $nCount = $nCount + 1; $s = vbCrlf() . $s . vbCrlf(); $dateClass = ADSql(getFileAttr($filePath, '3')); $visitUrl = ADSql(getStrCut($s, vbCrlf() . '来访', vbCrlf(), 0)); $viewUrl = ADSql(getStrCut($s, vbCrlf() . '当前:', vbCrlf(), 0)); $viewdatetime = ADSql(getStrCut($s, vbCrlf() . '时间:', vbCrlf(), 0)); $ip = ADSql(getStrCut($s, vbCrlf() . 'IP:', vbCrlf(), 0)); $browser = ADSql(getStrCut($s, vbCrlf() . 'browser: ', vbCrlf(), 0)); $operatingsystem = ADSql(getStrCut($s, vbCrlf() . 'operatingsystem=', vbCrlf(), 0)); $cookie = ADSql(getStrCut($s, vbCrlf() . 'Cookies=', vbCrlf(), 0)); $screenwh = ADSql(getStrCut($s, vbCrlf() . 'Screen=', vbCrlf(), 0)); $moreInfo = ADSql(getStrCut($s, vbCrlf() . '用户信息=', vbCrlf(), 0)); $browser = ADSql(getBrType($moreInfo)); if (inStr(vbCrlf() . $ipList . vbCrlf(), vbCrlf() . $ip . vbCrlf()) == false) { $ipList = $ipList . $ip . vbCrlf(); } $viewdatetime = replace($viewdatetime, '来访', '00'); if (isDate($viewdatetime) == false) { $viewdatetime = '1988/07/12 10:10:10'; } $screenwh = left($screenwh, 20); if (1 == 2) { aspEcho('编号', $nCount); aspEcho('dateClass', $dateClass); aspEcho('visitUrl', $visitUrl); aspEcho('viewUrl', $viewUrl); aspEcho('viewdatetime', $viewdatetime); aspEcho('IP', $ip); aspEcho('browser', $browser); aspEcho('operatingsystem', $operatingsystem); aspEcho('cookie', $cookie); aspEcho('screenwh', $screenwh); aspEcho('moreInfo', $moreInfo); HR(); } connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'websitestat (visiturl,viewurl,browser,operatingsystem,screenwh,moreinfo,viewdatetime,ip,dateclass) values(\'' . $visitUrl . '\',\'' . $viewUrl . '\',\'' . $browser . '\',\'' . $operatingsystem . '\',\'' . $screenwh . '\',\'' . $moreInfo . '\',\'' . $viewdatetime . '\',\'' . $ip . '\',\'' . $dateClass . '\')'); } } }