|
Another Graphic counter
variation on theme , slightly different code with
the same result .
Code :
<%
'graphic counter script by Iain Hendry
'copyright myscripting.com 2001
Dim objFSO , objFile
set objFSO = createobject("scripting.filesystemobject")
set objFile = objFSO.opentextfile(server.mappath("gcounter1.txt"))
'get the current count and store in counter
counter = clng(objFile.readline)
'add one to the current count
counter = counter + 1
'close file object
objFile.close
'write a new text object with the same name and new count
Set objFile = objFSO.CreateTextFile(server.mappath("gcounter1.txt"),
true)
objFile.writeline(counter)
'close file object
objFile.close
'
counter_length = len(counter)
'loop through the hit count and display the image
for i = 1 to counter_length
%>
<img src="images/1/<%= mid(counter,i,1) %>.gif">
<%
next
%>
|