<% sub UpdateCounter() const ForReading = 1 const ForWriting = 2 const ForAppending = 8 dDate = Date() 'Todays Date ' 'Create these files first. Make sure that anonymous account has 'write access to these two files ' Daily = "trivia.cnt" History = "history.cnt" set fso = CreateObject("Scripting.FileSystemObject") ' 'Open and read file which contains Grand Total and Daily Hit Counts ' set fr = fso.OpenTextFile(Server.MapPath(Daily), ForReading) GrandTotal = fr.Readline DailyTotal = fr.Readline fr.close ' 'Parse the DailyTotal line to get Date and Count ' Res = Split(DailyTotal," -> ") ' 'Open and update counter file. If new date, then reset Daily count to 1 ' set fw = fso.OpenTextFile(Server.MapPath(Daily), ForWriting, True) fw.writeline(GrandTotal+1) pos = InStr(1, DailyTotal, dDate) if pos = 0 then fw.writeline(dDate & " -> " & 1) else fw.writeline(Res(0) & " -> " & Res(1)+1) end if fw.close ' 'If new date, then open History file and append yesterdays Daily Total ' if pos = 0 then set fw = fso.OpenTextFile(Server.MapPath(History), ForAppending, True) fw.writeline(DailyTotal) fw.close end if end sub %> Dark Shadows Festival <%UpdateCounter()%>
  Dark Shadows Festival P.O. Box 92   Maplewood   NJ  07040  

TODAY’S TRIVIA
TBD