摘要:
自己的网站一直在使用别人提供的免费统计,如51YES,ITSUN,1TONG,51.LA,ADMIN88,50BANG等等,其中有很不错的统计系统,但免费归免费,这些服务器由于承受的负载都很大,偶尔还是会挂机的,一挂一般都是半天以上;况且有一些统计系统是不准确的.关键字:
ASP 统计 正文:
totalip+"&yesdayip&",totalpv=totalpv+"&yesdaypv&" where id = 1"
conn.execute(sql2)
删除昨天数据
sqlip="Delete FROM ip"
Conn.Execute sqlip
sqlurl="Delete FROM urls"
Conn.Execute sqlurl
sqlcome="Delete FROM comes"
Conn.Execute sqlcome
end if
end if
rs.close
set rs=nothing
IP在线列表统计
dim id
id=replace(Request.ServerVariables("REMOTE_HOST"),".","")
if Request.ServerVariables("HTTP_X_FORWARDED_FOR")<>"" then
id=replace(Request.ServerVariables("HTTP_X_FORWARDED_FOR"),".","")
end if
sql="select id from ip where id="&id&""
set rs=conn.execute(sql)
if rs.eof and rs.bof then
sql="insert into ip(id,ip,dlip,startime,lastime,browser,url) values ("&id&","&Request.ServerVariables("REMOTE_HOST")&","&Request.ServerVariables("HTTP_X_FORWARDED_FOR")&",now(),now(),"&Request.ServerVariables("HTTP_USER_AGENT")&","&Request.ServerVariables("HTTP_REFERER")&")"
else
sql="update ip set lastime=now(),url="&Request.ServerVariables("HTTP_REFERER")&",n=n+1 where id="&id&""
end if
conn.execute(sql)
rs.close
set rs=nothing
页面点击排行
dim url
url=Request.ServerVariables("HTTP_REFERER")
if url="" then
url="直接输入访问"
end if
if len(url)>240 then
url=left(url,240)
end if
sql="select url from urls where url="&url&""
set rs=conn.execute(sql)
if rs.eof and rs.bof then
sql="insert into urls(url) values ("&url&")"
else
sql="update urls set n=n+1 where url="&url&""
end if
conn.execute(sql)
rs.close
set rs=nothing
在线IP
function online()
sql="Select count(id) from ip WHERE DATEDIFF(s, lastime, now()) < "&kicktime&"*60"
set ips=conn.execute(sql)
online=ips(0)
ips.close
set ips=nothing
if isnull(online) then
online=0
end if
end function
今日IP
function todayip()
sql="Select count(id) from ip"
set ipss=conn.execute(sql)
todayip=ipss(0)
ipss.close
set ipss=nothing
if isnull(todayip) then
todayip=0
end if
end function
今日PV
function todaypv()
sql="Select sum(n) from ip"
set rs=conn.execute(sql)
If rs.eof and
[1][2][3][4][5][6][7][8][9][10]