|
The following is the Sample Script Code for Hit
Counter :
Paste the code given below in default.asp or index.asp file of
your web page.
Create a folder titled "Counter" and a text file "counter.txt".
<%
'MAKE SURE THAT THE FILE EXISXTS INITIALLY
path = Request.ServerVariables("APPL_PHYSICAL_PATH")
path = path&"\counter\counter.txt"
Set File = Server.CreateObject("Scripting.FileSystemObject")
set file2=file.OpenTextFile(path)
x=file2.readline
Response.Write(x)'This writes the count
set resfile = File.createTextFile (path)
resfile.writeline(x+1)
%>
|