M
Mike Brearley
I have a counter (alright one I found on asp101.com) that checks for a
session variable to prevent the counter from incrmenting if a user refreshes
the page or returns to the page during the same session. The problem is, it
also prevents other page counters from incrementing. Here's the code for
this part:
' Increment the count
if Session("iCount") <> iCount then
iCount = iCount + 1
Session("iCount") = iCount
end if
I changed iCount to another variable used within the code, and it works for
allowing other page counters to increment, but also increments a page you
already visited if you re-visit it and hit refresh.
' Increment the count
if Session("objCountFile") <> iCount then
iCount = iCount + 1
Session("objCountFile") = iCount
end if
The main code for the counter in on www.faerybug.com/counter.asp. I use an
include statement, <!-- #INCLUDE FILE="./counter.asp" --> to put the counter
on a page.
Is there something better I should use or look at (want the option of using
my own graphics for the numbers), or is there a way to get this counter to
increment only once per page per visit?
Thanks!!
--
Posted 'as is'. If there are any spelling and/or grammar mistakes, they
were a direct result of my fingers and brain not being synchronized or my
lack of caffeine.
Mike Brearley
session variable to prevent the counter from incrmenting if a user refreshes
the page or returns to the page during the same session. The problem is, it
also prevents other page counters from incrementing. Here's the code for
this part:
' Increment the count
if Session("iCount") <> iCount then
iCount = iCount + 1
Session("iCount") = iCount
end if
I changed iCount to another variable used within the code, and it works for
allowing other page counters to increment, but also increments a page you
already visited if you re-visit it and hit refresh.
' Increment the count
if Session("objCountFile") <> iCount then
iCount = iCount + 1
Session("objCountFile") = iCount
end if
The main code for the counter in on www.faerybug.com/counter.asp. I use an
include statement, <!-- #INCLUDE FILE="./counter.asp" --> to put the counter
on a page.
Is there something better I should use or look at (want the option of using
my own graphics for the numbers), or is there a way to get this counter to
increment only once per page per visit?
Thanks!!
--
Posted 'as is'. If there are any spelling and/or grammar mistakes, they
were a direct result of my fingers and brain not being synchronized or my
lack of caffeine.
Mike Brearley