
March 15th, 2013, 06:34 AM
|
|
Registered User
|
|
Join Date: Mar 2013
Posts: 2
Time spent in forums: 1 h 6 m 14 sec
Reputation Power: 0
|
|
|
Count clicks on a button
Hi,
Very new to ASP script, however I managed to do a script which counts the number of times a web page is accessed in a database, but in fact i wanted to count the number of times a button within the same page is clicked (count number of document downloaded).
Code:
<% ' simply return the username and domain from the server var Dim sluDomainUser : sluDomainUser = Trim(Request.ServerVariables("LOGON_USER")) Dim sluUserIDSlash : sluUserIDSlash = InStr(sluDomainUser,"\") 'Strip off domain and this becomes User ID sluUserName = LCase(Mid(sluDomainUser, sluUserIDSlash+1)) 'Remove domain sluDomain = UCase(Left(sluDomainUser, sluUserIDSlash-1)) ' ok lets create a session record sql = "INSERT INTO tblOfferDown (ulUserid, ulDateTime) VALUES ('" & sluUserName & " ', #" & Now() & "#)" If dbQuery(rs, sql)=False Then ' we have been unable to record user id Response.Write("Error") Response.End() End If ' End the session Call EndRoutine() %>
Any help is appreciated
Cheers
Last edited by vitordf : March 15th, 2013 at 08:10 AM.
Reason: re title
|