Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
Subject: | FLASH: RE: ASP counter with simple textfile |
From: | Juan Ulloa |
Date: | Thu, 25 Nov 1999 16:33:47 GMT |
I don't mean to be a mooch, but is there a way to implement that counter
using Flash 3 --using the command prompt and javascript? (and how? hee,
hee)
Juan
From: "Peter Brouwers" <p [dot] brouwerskw1c [dot] nl>
Subject: FLASH: ASP counter with simple textfile
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
Juan Ulloa
web page: http://www.sit.wisc.edu/~jculloa or http://travel.to/juan
e-mail: juank1bigfoot [dot] com
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
FLASH: Is 21,433K for a wav to big?, Goldlink Media
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]