📄 hits.asp
字号:
<!--#include file="conn.asp" -->
<%
Dim ID,Rs,SQL
Dim Hits,DayHits,WeekHits,MonthHits,HitsTime
If Not IsNumeric(Request("ID")) And Request("ID") <> "" then
Response.write"错误的系统参数!ID必须是数字"
Response.end
Else
ID = CLng(Request.querystring("ID"))
End If
Set Rs=server.createobject("adodb.recordset")
SQL = "select Hits,DayHits,WeekHits,MonthHits,HitsTime from NC_Article where ID = "& ID
Rs.open SQL,conn,1,3
Rs("Hits") = Rs("Hits") + 1
If DateDiff("D", Rs("HitsTime"), Now) <= 0 Then
Rs("DayHits") = Rs("DayHits") + 1
Else
Rs("DayHits") = 1
Rs("HitsTime") = Now
End If
If DateDiff("Ww", Rs("HitsTime"), Now) <= 0 Then
Rs("WeekHits") = Rs("WeekHits") + 1
Else
Rs("WeekHits") = 1
End If
If DateDiff("M", Rs("HitsTime"), Now) <= 0 Then
Rs("MonthHits") = Rs("MonthHits") + 1
Else
Rs("MonthHits") = 1
End If
If DateDiff("D", Rs("HitsTime"), Now) <= 0 Then
Rs("DayHits") = Rs("DayHits") + 1
Else
Rs("DayHits") = 1
Rs("HitsTime") = Now
End If
Rs.Update
Hits = Rs("Hits")
DayHits = Rs("DayHits")
WeekHits = Rs("WeekHits")
MonthHits = Rs("MonthHits")
Rs.close
set Rs=nothing
response.write "document.write ("& Chr(34) &"本日:"& DayHits &" 本周:"& WeekHits &" 本月:"& MonthHits &" 总浏览数:"& Hits &" "& Chr(34) &");"
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -