Copy Code code as follows:
<%
'//hittime Date: Get last access time
'//hits Digital: Get the total amount of browsing
'//hitsday Digital: Get today's browsing volume
'//hitsweeks digital: Get this week's browsing volume
'//hitmonths Digital: Get the volume of this month's browsing
' Database, add these 5 fields.
Set Rs1=server. CreateObject ("Adodb.recordset")
Rs1.open "SELECT * from Qwbmnewssss where id=26", conn,1,3
If rs1.eof and Rs1.bof then
Response.Write "Erry"
Else
Hittime = Rs1 ("hittime") ' Get last access time
Dim Daynow,monthnow,weeknow
Daynow = Day (date ()) ' What's the date
Monthnow = month (date ()) ' Now a few months
Weeknow = Weekday (date ()) ' Now the day of the week 0 for Sunday
Rs1 ("hits") = Rs1 ("hits") + 1 ' total browse times + 1
If DateDiff ("D", hittime,now ()) = 0 Then ' compare last accessed date with current time days
Rs1 ("hitsday") = Rs1 ("hitsday") + 1 ' Today's Browse amount + 1
Else
Rs1 ("hitsday") = 1 ' Today's browse amount = 1
End If
If Monthnow = month (hittime) then
Rs1 ("hitmonths") = Rs1 ("hitmonths") + 1 ' This month's browse volume + 1
Else
Rs1 ("hitmonths") = 1 ' This month's browse volume + 1
End If
If DateDiff ("D", Hittime,now ()) > 6 Then ' has a problem with the period of the week, if the previous time is Friday, the next visit is Tuesday of next week, and the record is superimposed.
Rs1 ("hitsweeks") = 1
Else
If Weeknow <> 1 Then
Rs1 ("hitsweeks") = Rs1 ("Hitsweeks") + 1
Else
WEEKNOWSS = Weekday (Hittime) ' Week of last visit
If Weeknow = Weeknowss Then
Rs1 ("hitsweeks") = Rs1 ("Hitsweeks") + 1
Else
Rs1 ("hitsweeks") = 1
End If
End If
End If
Rs1 ("hittime") = Now () ' Update last interview
Rs1.update
%>
Time Comparison: <%=datediff ("D", Hittime,now ())%><br/>
Current time: <%=now ()%><br/>
Last click Time: <%=hittime%><br/>
Current day: <%=daynow%><br/>
Current Month: <%=monthnow%><br/>
Current Week: <%=weeknow%><br/>
Total Views: <%=rs1 ("hits")%><br/>
Today's visits: <%=rs1 ("Hitsday")%><br/>
Week Visits: <%=rs1 ("Hitsweeks")%><br/>
Month Traffic: <%=rs1 ("hitmonths")%><br/>
<%
End If
Rs1.close
Set rs1=nothing
%>