I have a few pages in different areas that must reference a count in the same text file via asp.
Can i specify the file 'count8' somehow so that each page references the file from no matter what folder the page is in? I have tried using the full url, but it dindt work as i had suspecte.
Gary
Code:
<%
Dim sPath, filesys, count, getValue, update, twohrs
sPath = Request.ServerVariables("Path_Translated")
sPath = Left(sPath,InStrRev(sPath,"\")) & "counter8.txt"
Set filesys = CreateObject("Scripting.FileSystemObject")
Set getValue = filesys.OpenTextFile(sPath,1,0)
count = getValue.ReadLine
If Request.Cookies("blog")("recentvisitor") <> "yes" Then
count = Int(count) + 1
End If
getValue.Close
%>
<%
If Request.Cookies("blog")("recentvisitor") <> "yes" Then
Set update = filesys.CreateTextFile(sPath)
update.WriteLine(count)
update.Close
Response.Cookies("blog")("recentvisitor") = "yes"
twohrs = DateAdd("h", 1, Now)
Response.Cookies("blog").Expires = twohrs
End If
%>
<%
count = FormatNumber(count, 0, 0, -1, -1)
response.write "<font class='statred'>["& count &"]</font>"
%>
Can i specify the file 'count8' somehow so that each page references the file from no matter what folder the page is in? I have tried using the full url, but it dindt work as i had suspecte.
Gary