CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Hit Counter?

Print topic Send  topic

Author Message
Chris Moore
Posted: 08/06/2003, 1:00 PM

What is the best way to add a hit counter to my default.asp page? If a user
stays on the page and press's REFRESH, I do not want the counter updated. I
only want it updated if they have come from another website. Any ideas?

Thanks

Chris
Robert Sorrells
Posted: 08/07/2003, 3:10 PM

Hi Chris,

I'd start with this...
http://www.asp101.com/samples/counter.asp
to do the counter, then I'd modify the code a little and add the following:

if session("svHit")<>"Yes" then
' put your code here to increment the hit counter
session("svHit")="Yes"
end if

This way, someone can press Refresh, and it won't increment the hit counter,
as long as the session is active (usually 20 minutes w. no activity).

Bob



"Chris Moore" <chris@dblayout.com> wrote in message
news:Xns93CF98F8FEB3cabubba@66.180.229.147...
What is the best way to add a hit counter to my default.asp page? If a user
stays on the page and press's REFRESH, I do not want the counter updated. I
only want it updated if they have come from another website. Any ideas?

Thanks

Chris

Chris Moore
Posted: 08/07/2003, 5:27 PM

We think alike. That is exactly what I was doing. I am not real
fond of the timeout issue but I can live with it.

Thanks

Chris


"Robert Sorrells" <rsorrellsU@KNOWmindspring.com> wrote in
news:bguiol$57r$1@news.codecharge.com:

> Hi Chris,
>
> I'd start with this...
> http://www.asp101.com/samples/counter.asp
> to do the counter, then I'd modify the code a little and add
the
> following:
>
> if session("svHit")<>"Yes" then
> ' put your code here to increment the hit counter
> session("svHit")="Yes"
> end if
>
> This way, someone can press Refresh, and it won't increment the
hit
> counter, as long as the session is active (usually 20 minutes
w. no
> activity).
>
> Bob
>
>
>
> "Chris Moore" <chris@dblayout.com> wrote in message
>news:Xns93CF98F8FEB3cabubba@66.180.229.147...
> What is the best way to add a hit counter to my default.asp
page? If a
> user stays on the page and press's REFRESH, I do not want the
counter
> updated. I only want it updated if they have come from another
> website. Any ideas?
>
> Thanks
>
> Chris
>
>
>
Robert Sorrells
Posted: 08/08/2003, 4:35 AM

In addition to the session, you could add a cookie that expires in 1 day.
That way, you can check for the cookie and if its there, you don't count.
The problem with cookies is that many people have them blocked, so you'd
need to use the session variables as a backup.


"Chris Moore" <chris@dblayout.com> wrote in message
news:Xns93D0C61A46B7Adblayout@66.180.229.147...
We think alike. That is exactly what I was doing. I am not real
fond of the timeout issue but I can live with it.

Thanks

Chris



   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.