Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: coding for hit counter statistic ??


Message #1 by "Lady in Black" <phoenix1310@h...> on Tue, 23 Apr 2002 09:43:06 +0800
hi...
can u all help me....who know any coding for hit counter statistic ??
please help me!!!
thanx..



_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.

Message #2 by jake williamson 28 <jake.williamson@2...> on Tue, 23 Apr 2002 09:56:35 +0100
hi,

have a go with this:

<%
' Setting variables
Dim con, sql_insert, data_source
data_source = "dsn=yourDsnHere;"
sql_insert = "insert into HITS (SERVERADDRESS, BROWSER, OS, PAGE) values ('"
& Request.ServerVariables("SERVER_NAME") & "', '" &
Request.ServerVariables("HTTP_USER_AGENT") & "', '" &
Request.ServerVariables("HTTP_UA_OS") & "', 'bikes: " & Request("mnuRange")
& "')"
' Creating the Connection Object and opening the database
Set con = Server.CreateObject("ADODB.Connection")
con.Open data_source
' Executing the sql insertion code
con.Execute sql_insert
' Done. Now Close the connection
con.Close
Set con = Nothing
%>

it basically writes the url, browser, os, page and date/time to a database
table called HITS.

should give a results like:

www.url.com    Mozilla/4.0 (compatible; MSIE 5.01; Windows NT;)    page
22/04/2002

the os only seems to recognise mac os at the mo, still working on that!

the page bit has been build around a page name followed by a variable
request (in this a case a pop up menu value sent in a url string)

hope this helps,

jake


on 23/4/02 2:43, Lady in Black at phoenix1310@h... wrote:

> hi...
> can u all help me....who know any coding for hit counter statistic ??
> please help me!!!
> thanx..


  Return to Index