|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<%
mode = LCASE(Request("mode"))
gif = Request("gif")
Set conn = Server.CreateObject("ADODB.Connection")
DBPath = Server.MapPath("count/counter.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
SET rs = Server.CreateObject("ADODB.Recordset")
Rs.Open "Select * From counters" , conn,1,3
LASTIP = RS("LASTIP")
NEWIP = REQUEST.servervariables("REMOTE_ADDR")
IF CSTR(Month(RS("DATE"))) <> CSTR(Month(DATE())) THEN
RS("DATE") = DATE()
RS("YESTERDAY") = RS("TODAY")
RS("BMONTH") = RS("MONTH")
RS("MONTH") = 1
RS("TODAY") = 1
RS.Update
ELSE
IF CSTR(Day(RS("DATE"))) <> CSTR(Day(DATE())) THEN
RS("DATE") = DATE()
RS("YESTERDAY") = RS("TODAY")
RS("TODAY") = 1
RS.Update
END IF
END IF
RS("TOTAL") = RS("TOTAL") + 1
RS("TODAY") = RS("TODAY") + 1
RS("MONTH") = RS("MONTH") + 1
RS.Update
response.write "本站浏览总人数:"
GCounter( RS("TOTAL") )
response.write " "
response.write "今日浏览总人数:"
GCounter( RS("TODAY") )
response.write " "
response.write "昨日浏览总人数:"
GCounter( RS("YESTERDAY") )
response.write " "
response.write "本月浏览总人数:"
GCounter( RS("MONTH") )
response.write " "
response.write "上月浏览总人数:"
GCounter( RS("BMONTH") )
response.write " "
response.write " | "
response.write " "
CONN.CLOSE
Function GCounter( counter )
Dim S, i, G
S = CStr( counter )
For i = 1 to Len(S)
G = G & " "
Next
response.write G
End Function
%>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|