Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP Refresh

Status
Not open for further replies.

MoaD

Programmer
Apr 17, 2002
17
CA
How do i determine if a user is refreshing the page.

I want to know this cause everytime a user view the page a counter is increased but i only want to increase the counter if it from click a link and not just refreshing the page

thanks in advance
 
Man i cant type today sorry bout that lol
 
I use this counter in a global.asa. The user gets one count until they close there browser and go back into it. If you do it this way it may help out.

<SCRIPT LANGUAGE=&quot;Vbscript&quot; RUNAT=&quot;Server&quot;>
Sub Application_OnStart
Application(&quot;countUsers&quot;)=0
Application(&quot;start&quot;)=Now()
Application(&quot;total&quot;)=0
Application(&quot;date&quot;)=Date()
End Sub
Sub Application_OnEnd

End Sub
Sub Session_OnStart
Session(&quot;count&quot;)
Application.Lock
Session(&quot;count&quot;)=CInt(Application(&quot;countUsers&quot;))
Session(&quot;count&quot;)=Session(&quot;count&quot;) + 1
Application(&quot;countUsers&quot;)=Session(&quot;count&quot;)
Application.UnLock
Session(&quot;start&quot;)=Now()
End Sub
Sub Session_OnEnd
session.Abandon
End Sub

</SCRIPT>


in the index.asp

You are visitor number <%= Application(&quot;countUsers&quot;) %> provide tools to let people become their best.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top