% ' Script adds page hits to your database ' Add this on every page you want to count ' Of course you can retrieve the values and display them on any page ' thisURL = Request.ServerVariables("PATH_INFO") Set cnn1 = Server.CreateObject("ADODB.Connection") 'openStr = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ '"Data Source=" & Server.MapPath("..\..\db\pagecounters.mdb") 'cnn1.Open openStr,"","" 'sql = "SELECT url, hitcnt, lasthit " & _ '"FROM hitcounts " & _ '"WHERE url = '" & thisURL & "';" 'Set recordHits= Server.CreateObject("ADODB.Recordset") 'recordHits.Open sql, cnn1, 2, 2, 1 'If recordHits.EOF Then 'recordHits.AddNew 'recordHits("url") = thisURL 'curCount = 1 'Else 'curCount = recordHits("hitcnt") + 1 'end If 'recordHits("hitcnt") = curCount 'recordHits("lasthit") = Now() 'recordHits.Update 'recordHits.Close 'set recordHits = Nothing 'cnn1.Close 'set cnn1 = Nothing %> <% %>
![]() |
||
|
|
|
|||
|
|
تم تحديث الموقع في 09/24/06