<%
Sub Main()
Dim cn
Dim rsHits
Dim strHit
Dim strArray(5)
Dim i,j
Dim intDigit
If Session("appHits") = 0 Then
Set cn=Server.CreateObject("ADODB.Connection")
Set rsHits = server.CreateObject("ADODB.Recordset")
cn.ConnectionString = "Data Source=SITASP.NORTH"
cn.Open
rsHits.Open "Select * From Hits",cn,adOpenKeyset,adLockPessimistic
rsHits.AddNew
rsHits.Fields(1) = Request.ServerVariables("REMOTE_ADDR")
rsHits.Fields(2) = date
rsHits.Update
rsHits.MoveLast
strHit = cstr(rsHits.Fields(0))
rsHits.Close
cn.Close
set cn = nothing
set rsHits = nothing
Session("appHits") = CINT(strHit)
Else
strHit = Cstr(Session("appHits"))
End if
%>
<%
' AVOID THESE LINES IF YOU DONT WANT PICTURED COUNTER
' ===================================================
' THIS IS A SEVEN DIGIT COUNTER
' In case you want a COUNTER based on GIF FILE Then Change jpg to GIF
' in two places
' IN CASE YOU WANT TO REDUCE DIGITS THEN CHANGE 7 to a suitable number
For i = 1 to 5
' In case you have Gif files Change Here and in another place
strArray(i)="pics\0.jpg"
Next
j=5
For i = len(strHit) to 1 step -1
intDigit=CInt(Mid(strHit,i,1))
strArray(j)="pics\"& intDigit & ".jpg"
j = j - 1
Next
' FINAL OUTPUT CODE IS HERE
' =========================
'
'For i = 1 to 7
' Response.Write("
 & )
")
'Response.Write(strArray(i)& " ")
'Next
' This is the Only Line You Should have if you dont
' want Picture Based Counter
Response.Write("You are Visitor Number " & strHit)
End Sub
%>