📄 tran.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<% startime=timer()%>
<!--#include file="const.asp"-->
<!--#include file="inc.asp"-->
<%
'收集需要统计的信息
vIp = request.ServerVariables("Remote_Addr") '访问者IP
vSoft=Request.ServerVariables("HTTP_USER_AGENT")
vReferer = request("referer")
iReferer = request("referer")
if vReferer="" then
vReferer="直接输入网址进入的"
iReferer="直接输入网址进入的"
else
vReferer=Mid(vReferer,8)
vReferer="http://"&Mid(vReferer,1,instr(vReferer,"/"))
end if
if instr(vSoft,"NetCaptor") then ' 浏览器
vExplorer="NetCaptor"
elseif instr(vSoft,"MSIE 6") then
vExplorer="Internet Explorer 6.x"
elseif instr(vSoft,"MSIE 5") then
vExplorer="Internet Explorer 5.x"
elseif instr(vSoft,"MSIE 4") then
vExplorer="Internet Explorer 4.x"
elseif instr(vSoft,"Netscape") then
vExplorer="Netscape"
elseif instr(vSoft,"Opera") then
vExplorer="Opera"
else
vExplorer="Other"
end if
if instr(vSoft,"Windows NT 5.0") then ' 操作系统
vOS="Windows 2000"
elseif instr(vSoft,"Windows NT 5.1") then
vOS="Windows XP"
elseif instr(vSoft,"Windows NT 5.2") then
vOS="Windows 2003"
elseif instr(vSoft,"Windows NT") then
vOS="Windows NT"
elseif instr(vSoft,"Windows 9") then
vOS="Windows 9x"
elseif instr(vSoft,"unix") or instr(vSoft,"linux") or instr(vSoft,"SunOS") or instr(vSoft,"SunOS") or instr(vSoft,"BSD") or instr(vSoft,"Mac") then
vOS="Unix & Unix 类"
else
vOS="Other"
end if
vYear=year(now()) '年
vMonth=month(now()) '月
vDay=day(now()) '日
vHour=hour(now()) '时
vTime=now() '时间 xxxx-xx-xx xx:xx:xx
vDate=date()
Tp_Ip = vIp
Conn.execute "update flux set refurbish=refurbish+1 where id=1"
Tp_IP = Fn_IP(Tp_Ip)
if not GetVister(Tp_Ip) and session("isVisit")<>"yes" then
'查看Ip所在地区
vWhereB = GetWhere(Tp_Ip)
call RValue("select cWhere as cv,cCWC as cc from cW where cWhere='"&vWhereB&"'",vWhereB)
call RValue("select cReferer as cv,cCRC as cc from cR where cReferer='"&vReferer&"'",vReferer)
Conn.execute "update cH set cTHC=0 where DATEDIFF('h',HMD,Now()) > 1 and cHour=" & vHour
Conn.execute "update cD set cTDC=0 where DATEDIFF('d',DMD,Now()) > 1 and cDay=" & vDay
Conn.execute "update cM set cTMC=0 where DATEDIFF('m',MMD,Now()) > 1 and cMonth=" & vMonth
Conn.execute "update (select * from (select top 1 * from last20vister order by cCT asc,id asc) as lv,(select * from cM where cMonth=" & vMonth & " ) as lcM,(select * from cD where cDay=" & vDay & " ) as lcD,(select * from cH where cHour=" & vHour & " ) as lcH,(select * from cE where cExplorer='" & vExplorer & "') as lcE,(select * from cO where cOS='" & vOS & "') as lcO ) as c set cCT=now(),cCIP='"&vIp&"',cCOS='"&vOS&"',cCEXP='"&vExplorer&"',cCW='"&vWhereB&"',cCR='"&iReferer&"',cTMC=cTMC+1,cCMC=cCMC+1,MMD=now(),cTDC=cTDC+1,cCDC=cCDC+1,DMD=now(),cTHC=cTHC+1,cCHC=cCHC+1,HMD=now(),cCEC=cCEC+1,cCOC=cCOC+1"
session("isVisit")="yes"
end if
'1或者没有参数显示图标,0不显示图标,2显示文字
style = request("style")
Select Case style
Case "0"
c_debug=0
Case "1",""
vSql = "select cD.cTDC as todaycount,SumCount.ccount from cD,(select sum(cCMC) as ccount from cM) as SumCount where cD.cDay="&vDay
Set vRs = GetRs(vSql)
vCount = vRs("ccount")
vToday = vRs("todaycount")
vRs.close
Set oRs = Application(ConnName&"PconnII").execute("select count(*) as oc from v where DATEDIFF('n',mt,Now()) < "&OnlineTime)
vOnlineUser = oRs("oc")
oRs.close
vTheurl="http://" & Request.ServerVariables("http_host") & Fn_Dir(Request.ServerVariables("url"))
outstr="<a href='" & vTheurl & "index.asp' target='_blank' style='color: #ffffff; text-decoration: none'>"
outstr=outstr & "<img src='" & vTheurl & "images/mc.gif' border=0 alt='总访问量: " & vCount & " 今日访问: " & vToday&" 在线人数: "&vOnlineUser&"'>"
outstr=outstr & "</a><br>"
Case "2"
vSql = "select cD.cTDC as todaycount,SumCount.ccount from cD,(select sum(cCMC) as ccount from cM) as SumCount where cD.cDay="&vDay
Set vRs = GetRs(vSql)
vCount = vRs("ccount")
vToday = vRs("todaycount")
vRs.close
Set oRs = Application(ConnName&"PconnII").execute("select count(*) as oc from v where DATEDIFF('n',mt,Now()) < "&OnlineTime)
vOnlineUser = oRs("oc")
oRs.close
vTheurl="http://" & Request.ServerVariables("http_host") & Fn_Dir(Request.ServerVariables("url"))
outstr="<a href='" & vTheurl & "index.asp' target='_blank' style='text-decoration: none'>"
outstr=outstr & "总访问量: " & vCount & " 今日访问: " & vToday&" 在线人数: "&vOnlineUser&""
outstr=outstr & "</a><br>"
End Select
if c_debug=1 then
endtime=timer()
outstr = outstr & "统计执行时间:"&FormatNumber((endtime-startime)*1000,3)&"毫秒"
end if
Response.Write "document.write(" & chr(34) & outstr & chr(34) & ")"
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -