Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
If Session("HitCounter") = "Yes" Then
'Do nothing, already registered current visitor
Else
'Insert record into HitCounter table
Session("HitCounter") = "Yes"
End If
<!--#INCLUDE VIRTUAL="/includes/connaction.asp" -->
<%
DIM mySQL, objRS
mySQL = "SELECT * FROM tblTotalHits"
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open mySQL, objConn, adOpenKeyset, adLockPessimistic, adCmdText
DIM iRecordCount
objRS.MoveFirst
iRecordCount = objRS("Hits")
objRS("Hits") = iRecordCount + 1
objRS.Update
%>
Our website has received <% =objRS("Hits") %> total hits.
<%
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
<!-- #INCLUDE VIRTUAL="/YOUR FILE PATH HERE/totalhits.asp" -->
<HTML><HEAD>
<TITLE>ASP Web Pro</TITLE>
</HEAD>
<BODY>
The rest of your page here.
</BODY>
</HTML>
<%
Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
HitsFile = Server.MapPath ("/statistics") & "\totalhits.txt"
Set InStream= FileObject.OpenTextFile (HitsFile, 1, false )
OldHits = Trim(InStream.ReadLine)
NewHits = OldHits + 1
Set OutStream= FileObject.CreateTextFile (HitsFile, True)
OutStream.WriteLine(NewHits)
%>