function setRParam($ConfigPath, $paramName, $paramValue, $isNoAdd) { $content = ''; $startStr = ''; $endStr = ''; $s = ''; $content = PHPTrim(getFText($ConfigPath)); $startStr = $paramName . '=\''; $endStr = '\''; if (inStr($content, $startStr) > 0 && inStr($content, $endStr) > 0) { $s = StrCut($content, $startStr, $endStr, 2); $content = replace($content, $startStr . $s . $endStr, $startStr . $paramValue . $endStr); createFile($ConfigPath, $content); } else { if (aspTrim($isNoAdd) == '1') { CreateAddFile($ConfigPath, $startStr . $paramValue . $endStr); } } }
function handleLink($httpUrl, $content, $sType, $SetStr, $UrlOrContent, &$PubAHrefList, &$PubATitleList) { $splStr = ''; $i = ''; $s = ''; $c = ''; $TempContent = ''; $FindUrl = ''; $HandleUrl = ''; $startStr = ''; $endStr = ''; $s1 = ''; $s2 = ''; $tempHttpUrl = ''; $tempHttpUrl = $httpUrl; $UrlOrContent = lCase($UrlOrContent); $content = replace(replace($content, '= ', '='), '= ', '='); $content = replace(replace($content, ' =', '='), ' =', '='); $TempContent = lCase($content); //没有链接退出 if (inStr($TempContent, ' href=') == 0 && inStr($TempContent, ' src=') == 0 && $sType != 'style') { $handleLink = ''; return @$handleLink; } else { if (inStr($TempContent, ' href=\\"') > 0) { $content = replace($content, '\\"', '"'); $TempContent = lCase($content); } } $startStr = $sType . '="'; $endStr = '"'; if (inStr($TempContent, $startStr) > 0 && inStr($TempContent, $endStr) > 0) { //call echo("提示","1") $FindUrl = StrCut($content, $startStr, $endStr, 2); if ($SetStr != '') { $HandleUrl = $SetStr; } else { $HandleUrl = fullHttpUrl($httpUrl, $FindUrl); //替换目录 if ($UrlOrContent == 'replacedir') { $HandleUrl = $tempHttpUrl . handleFilePathArray($HandleUrl)[2]; } $PubAHrefList = $PubAHrefList . hanldeStyleBackgroundUrl($HandleUrl, '', '') . vbCrlf(); //链接标题 $s1 = inStr($content, '>'); $s2 = right($content, len($content) - $s1); $s2 = mid($s2, 1, inStrRev($s2, '</') - 1); $s2 = replace($s2, vbCrlf(), '【换行】'); $PubATitleList = $PubATitleList . $s2 . vbCrlf(); } if ($FindUrl != $HandleUrl) { //强强强旱替换 $s1 = inStr($content, $startStr) - 1 + len($startStr); //这里面用TempContent而不用Content因为有大小写在里面20140726 $s2 = right($content, len($content) - $s1); $s2 = mid($s2, inStr($s2, $endStr), -1); $s1 = left($content, $s1); $content = $s1 . $HandleUrl . $s2; } if ($UrlOrContent == 'url') { $handleLink = $HandleUrl; } else { $handleLink = $content; } return @$handleLink; } $startStr = $sType . '=\''; $endStr = '\''; if (inStr($TempContent, $startStr) > 0 && inStr($TempContent, $endStr) > 0) { //call echo("提示","2") $FindUrl = StrCut($TempContent, $startStr, $endStr, 2); if ($SetStr != '') { $HandleUrl = $SetStr; } else { $HandleUrl = fullHttpUrl($httpUrl, $FindUrl); //替换目录 if ($UrlOrContent == 'replacedir') { $HandleUrl = $tempHttpUrl . handleFilePathArray($HandleUrl)[2]; } $PubAHrefList = $PubAHrefList . hanldeStyleBackgroundUrl($HandleUrl, '', '') . vbCrlf(); //链接标题 $s1 = inStr($content, '>'); $s2 = right($content, len($content) - $s1); $s2 = mid($s2, 1, inStrRev($s2, '</') - 1); $s2 = replace($s2, vbCrlf(), '【换行】'); $PubATitleList = $PubATitleList . $s2 . vbCrlf(); } if ($FindUrl != $HandleUrl) { //强强强旱替换 $s1 = inStr($content, $startStr) - 1 + len($startStr); $s2 = right($content, len($content) - $s1); $s2 = mid($s2, inStr($s2, $endStr), -1); $s1 = left($content, $s1); $content = $s1 . $HandleUrl . $s2; } if ($UrlOrContent == 'url') { $handleLink = $HandleUrl; } else { $handleLink = $content; } return @$handleLink; } $startStr = $sType . '='; $endStr = '>'; //这里面把之家的 空格换成> if (inStr($TempContent, $startStr) > 0 && inStr($TempContent, $endStr) > 0) { $FindUrl = StrCut($TempContent, $startStr, $endStr, 2); if ($SetStr != '') { $HandleUrl = $SetStr; } else { $HandleUrl = fullHttpUrl($httpUrl, $FindUrl); //替换目录 if ($UrlOrContent == 'replacedir') { $HandleUrl = $tempHttpUrl . handleFilePathArray($HandleUrl)[2]; } $PubAHrefList = $PubAHrefList . hanldeStyleBackgroundUrl(handleHttpUrl($HandleUrl), '', '') . vbCrlf(); //链接标题 $s1 = inStr($content, '>'); $s2 = right($content, len($content) - $s1); $s2 = mid($s2, 1, inStrRev($s2, '</') - 1); $s2 = replace($s2, vbCrlf(), '【换行】'); $PubATitleList = $PubATitleList . $s2 . vbCrlf(); } if ($FindUrl != $HandleUrl) { //强强强旱替换 $s1 = inStr($content, $startStr) - 1 + len($startStr); $s2 = right($content, len($content) - $s1); $s2 = mid($s2, inStr($s2, $endStr), -1); $s1 = left($content, $s1); $content = $s1 . $HandleUrl . $s2; } if ($UrlOrContent == 'url') { $handleLink = $HandleUrl; } else { $handleLink = $content; } return @$handleLink; } if ($UrlOrContent != 'url') { $handleLink = $content; } CreateAddFile('出错内容列表.txt', $httpUrl . vbCrlf() . $content . vbCrlf() . $sType . vbCrlf() . $SetStr . vbCrlf() . $UrlOrContent . vbCrlf() . '----------------------' . vbCrlf()); return @$handleLink; }
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; }