Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
Subject: | FLASH: ASP counter with simple textfile |
From: | Peter Brouwers |
Date: | Thu, 25 Nov 1999 11:13:16 GMT |
Use this script to count hits, stored in a ascii file:
<SCRIPT LANGUAGE=VBSCRIPT RUNAT=SERVER></SCRIPT>
<%
Function txtPageCounter
Dim tmpHitCount,textObject,pagename,fhandle
pagename = Request.serverVariables("PATH_TRANSLATED") & ".cnt"
If Session(pagename) = "" Then
Application.Lock
Set textObject = CreateObject("Scripting.FileSystemObject")
If textObject.FileExists(pagename) Then
Set fhandle = textObject.OpenTextFile(pagename)
tmpHitCount = fhandle.readline
fhandle.close
Else
tmpHitCount = 0
End If
tmpHitcount = tmpHitCount + 1
Set fhandle = textObject.CreateTextFile(pagename)
fhandle.writeline (tmpHitCount)
fhandle.close
Application.UnLock
Session(pagename) = tmpHitCount
Else tmpHitCount = Session(pagename)
End If
' tmpHitCount has the hit count,
' return it as the value of the function '
txtPageCounter = tmpHitCount
End Function
response.write("aspcount="& txtPageCounter)
%>
Save the above as: count.asp, and call it as a LoadVariable URL
Have Flash pick up the aspcount var and display in a textfield.
For an example look at:
http://www.derijen.nl/taiji
NB No copyrights, use it, copy it, spread it among your friends etc
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Streaming Media WEST '99 Conference & Exhibition
"The Worlds largest Internet Audio & Video Event"
December 7 - 9, San Jose Convention Center, California
Reserve your space today at http://www.streamingmedia.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpchinwag [dot] com
Replies
Re: FLASH: ASP counter with simple textf, oliver b�hm
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]