Trying to get simple global.asa file to work with

Results 1 to 2 of 2

Thread: Trying to get simple global.asa file to work with

  1. #1
    Julia Green Guest

    Default Trying to get simple global.asa file to work with

    Hi everyone --<BR><BR><BR>If you can, send me an email at that you&#039ve posted.<BR><BR>My mahjong counter increments fine throughout the day, but everyday it resets to one which leads me to think that there is a problem with the Date function in the global.asa file. I have tried leaving it just as Date, "8/26/00", or 8/26/2000" - nothing works. Please help. I am also enclosing the ASP code that reads the Mah Jong digits for the counter.<BR><BR>Thanks -- Julia Green<BR><BR><BR>global.asa<BR><BR><BR>&#060;SCRIP T RUNAT="Server" LANGUAGE="VBScript"&#062; <BR> <BR>sub Session_OnStart <BR> &#039Lock the Application for concurrency issues <BR> Application.Lock <BR> <BR> &#039Increment the counter <BR> Application("Hits") = Application("Hits") + 1 <BR> <BR> &#039Unlock the Application <BR> Application.UnLock <BR>end sub <BR> <BR>sub Application_OnStart <BR> &#039This variable Hits will store the # of visitors <BR> Application("Hits") = 0 <BR><BR><BR> &#039From the date stored in AsOfDate... <BR> Application("AsOfDate") = Date <BR>end sub <BR>&#060;/SCRIPT&#062; <BR><BR><BR>graphical ASP<BR><BR><BR>&#060;% <BR>&#039 Graphical Hit Counter Example By (modified by Julia Green) <BR><BR><BR>&#039 Declare variables <BR>Dim ObjCounterFile, ReadCounterFile, WriteCounterFile <BR>Dim CounterFile <BR>Dim CounterHits <BR>Dim FixedDigitCount <BR>Dim DigitCount <BR>Dim DigitCountLength <BR>Dim DigitZerosToAdd <BR>Dim DigitZeroCount <BR>Dim ShowDigits <BR>Dim DigitPath <BR><BR><BR>&#039 (FixedDigitCount) will add zeros to the front of your count <BR>&#039 if the count is less then the (FixedDigitCount) <BR>&#039 just like "frontpage" counters let you do <BR><BR><BR>FixedDigitCount = 5 <BR>DigitPath = "" <BR><BR><BR>On Error Resume Next <BR><BR><BR>Set ObjCounterFile = Server.CreateObject("Scripting.FileSystemObject") <BR><BR><BR>CounterHits=Application("Hits") <BR><BR><BR>Set ObjCounterFile = Nothing <BR><BR><BR>DigitCountLength = Len(CounterHits) <BR><BR><BR>If DigitCountLength &#060; FixedDigitCount Then <BR> DigitZerosToAdd= FixedDigitCount - DigitCountLength <BR> DigitZeroCount = 1 <BR> For DigitZeroCount = DigitZeroCount to DigitZerosToAdd <BR> ShowDigits = ShowDigits & "&#060;img src=""" & DigitPath & "/0.gif"" Alt =""" & CounterHits & " Visitors"" &#062;" <BR> Next <BR>End If <BR><BR><BR>DigitCount = 1 <BR>For DigitCount = DigitCount to DigitCountLength <BR> ShowDigits = ShowDigits & "&#060;img src=""" & DigitPath & "/" & Mid(CounterHits,DigitCount,1) & ".gif"" Alt =""" & CounterHits & "Visitors""&#062;" <BR>Next <BR>%&#062; <BR><BR><BR>&#060;% =ShowDigits %&#062; <BR><BR><BR>

  2. #2
    balletchick Guest

    Default RE: Trying to get simple global.asa file to work w

    Hi Jules,<BR><BR>It looks to me like you do not store the counter in any persistent manner (e.g. text file, database, etc.), so it will ALWAYS start over when the system is reset. (Although it DOES look like you started to do that... you create an FSO object, but then destroy it before doing anything with it...)<BR><BR>My guess is that your server goes down (rebooted) once a day (like many NT servers are). Could that be correct?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts