⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.asp

📁 统计系统
💻 ASP
字号:
<%
     mode = LCASE(Request("mode"))
     Set conn = Server.CreateObject("ADODB.Connection")
     DBPath = Server.MapPath("data.mdb")
     conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
     SET rs = Server.CreateObject("ADODB.Recordset")
     Rs.Open "Select * From counters" , conn,1,3

 

 IF CSTR(Month(RS("DATE"))) <> CSTR(Month(DATE())) THEN    

       RS("DATE") = DATE()                      
       RS("YESTERDAY") = RS("TODAY")            
       RS("BMONTH") = RS("MONTH")
       RS("MONTH") = 0
       RS("TODAY") = 0                          
       RS.Update                                

 
 	ELSE

	   IF CSTR(Day(RS("DATE"))) <> CSTR(Day(DATE())) THEN    
	       RS("DATE") = DATE()                      
	       RS("YESTERDAY") = RS("TODAY")            
	       RS("TODAY") = 0
	       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  "<font size=2 color=000099>今日浏览总人数:</font>"
             numshow( RS("TODAY") )
             response.write "<br>"

             response.write  "<font size=2  color=000099>昨日浏览总人数:</font>"
             numshow( RS("YESTERDAY") )
             response.write "<br>"
             
             response.write  "<font size=2  color=000099>本月浏览总人数:</font>"
             numshow( RS("MONTH") )
             response.write "<br>"

             response.write  "<font size=2  color=000099>上月浏览总人数:</font>"
             numshow( RS("BMONTH") )
             response.write "<br>"

		response.write  "<font  size=2 color=000099>本站浏览总人数:</font>"
             numshow( RS("TOTAL") )
             response.write "<br>"

response.write "</td>"
response.write "<td valign=""top"">"
N = Now
D2 = DateValue(N)
D1 =  #09/01/2004#                                                    ' 开始统计日期(月/日/年)


response.write  "<font  size=2 color=000099>开站至今天的总天数:</font>"
             numshow( DateDiff("d", D1, D2) )
response.write "<br>"
D3 = DateDiff("d", D1, D2)
response.write  "<font  size=2 color=000099>平均人数/日:</font>"
             numshow( RS("TOTAL")\D3 )

             CONN.CLOSE                        


Function numshow( counter )

   Dim S, i, G
   S = CStr( counter )  

   For i = 1 to Len(S)

      G = G & "<IMG SRC=./gif/" & Mid(S, i, 1) & ".gif Align=middle>"
   Next
 response.write G

End Function

%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -