Creating Hit Counter

paranoya90

New Member
I am trying to create a hit counter in VBScript on a HTML Page for specific client needs. I cannot use any hit counters available for free.My problem is that my code only finds the text file on my notebook (Local C:\ drive) and not in the website, even though the file does exist. My other problem is that when the page code reaches the \[code\]server.creatobject\[/code\] line, I get the error \[code\]Microsoft VBScript runtime error: Object required: 'server'\[/code\].I write mostly in VB but the client wants a specific HTML page and NOT ASP/ASPX. Can someone help me please? I have been trying for a while and cannot get a decent answer to my above questions.Below is the code.\[code\]<SCRIPT LANGUAGE="VBScript" RUNAT="Server">Dim fsodim tsodim FilObjectdim VisitorCountdim strOutputNamedim objOutputfilestrfilename ="counter.txt"set fso=server.createobject("scripting.filesystemobject")set filobject=fso.getfile(strfilename)set tso=filobject.openastextstreamvisitorcount=clng(tso.readall)visitorcount=visitorcount + 1stroutputname=strfilenameset objoutputfile=fso.createtextfile(stroutputname,true)objoutputfile.writeline visitorcountdocument.write(visitorcount)</script>\[/code\]
 
Back
Top