Replies Back to Article
Hit Counter
I've got the code below on one of my index pages (.asp), you'll need a folder called counter, and a text file called hits.txt in it, the hits.txt file will need a single numeric with no char returns poss starting at zero. You'll have to add the code above all tags on the page you want to count ie above the <head> tag, your page will need to have the .asp ext otherwise it won't work, very simple, but it does have it's drawbacks, its not a true hits counter.
<%
Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
HitsFile = Server.MapPath ("counter/hits.txt")
Set InStream= FileObject.OpenTextFile (HitsFile, 1, false )
OldHits = Trim(InStream.ReadLine)
NewHits = OldHits + 1
Set OutStream= FileObject.CreateTextFile (HitsFile, True)
OutStream.WriteLine(NewHits)
%>
regards
Ish
Hi!
I'm also new on the dreamweaver mx 2004 design application. I'm trying to get a hit counter on my basic htm dreamweaver page. I would like to know if any of you can help me please. I understand the concept but i don't know how to implemented.
Thanks in advance.
Try setting-up one of the hit counters with a link to a sponcer. When you copy the code into Dreamweaver, look for the adress of the sponcer in the code. The just delet the link to the sponcer. That could solve your problem
![](downloads/UserImages/613.gif)
Hi yea,
this is an excellent counter extension for dreamweaver and it is free.
http://www.felixone.it/extensions/dwextensionsen.asp?application=%25&environment=%25&Submit=Search&type=%3E%3D&offset=30
regars
Kenny