MyEspinda! .Customers Login Here

Ready to use Hit Counter

Easy to use ASP counter that does not need SSI but it must be added to *.asp files, if you didn't use any special extension, renaming your HTML files to *.asp is enough to make this code work.

Features :
- You can add multiple counters to files and edit 1 line in code.
- Text counter font tags "<font>" can customize its appearance or can make it invisible.

Customization :
- If you dont't want to start counting from 0, change the value found in counter.txt
- Counter.txt is generated for the first time, if removed the counting will be reset to 0.
- If you want to use multiple counters in the same directory, change the "counter.txt" value in every file code.

Installation :
Copy the code from the text box and paste it directly into your ASP page :

<% =CounterHits %>
<%
Dim ObjCounterFile, ReadCounterFile, WriteCounterFile
Dim CounterFile
Dim CounterHits
Set ObjCounterFile = Server.CreateObject("Scripting.FileSystemObject")
CounterFile = Server.MapPath ("counter.txt")
Set ReadCounterFile= ObjCounterFile.OpenTextFile (CounterFile, 1, True)
If Not ReadCounterFile.AtEndOfStream Then
CounterHits = Trim(ReadCounterFile.ReadLine)
If CounterHits = "" Then CounterHits = 0
Else
CounterHits = 0
End If
ReadCounterFile.Close
Set ReadCounterFile = Nothing
CounterHits = CounterHits + 1
Set WriteCounterFile= ObjCounterFile.CreateTextFile (CounterFile, True)
WriteCounterFile.WriteLine(CounterHits)
WriteCounterFile.Close
Set WriteCounterFile = Nothing
Set ObjCounterFile = Nothing
%>
<% =CounterHits %>

Home|About Espinda|Hosting Plans|Tools|FAQ|Contact|Support|Terms of Service|Site Map|Order