Monday, December 17, 2007

How to create a Counter

How to create a Counter

S T E P - 1

- We can use Server.CreateObject to create a counter. If your web server has already prebuilt a counter, you not need to do it because all web server users will be using same counter:

<% Set myCounter = Server.CreateObject("MSWC.Counters") %>

S T E P - 2

- We need to initialize the counter:

<%

Dim mailHits

myCounter.Set(mailHits, 0)

%>

S T E P - 3

- Use MailHits to count the visitor.

<%

Counter.Increment(mailHits)

Response.write("You are " & Counter.Get(mailHits) %> & " visitor")

%>


No comments: