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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hit Counter?

Status
Not open for further replies.

tina2

IS-IT--Management
Joined
May 1, 2001
Messages
169
Location
US
I am fairly new to Cold Fusion, but I have experience with ASP. I am wondering if anyone has had experience with using the CF_Counter custom tag? I would like to track hits on every page, but am not interested in purchasing third party software or hosting. Would this be a wise route to take, or could anyone recommend another option?

Many thanks,
Tina
 
hi tina2

This is GunJack's post from thread232-106039

I think there were a few mistakes. I would never presume to correct GJ, hehe, but this is a little more succinct.


<cfapplication name=&quot;myApp&quot; sessionmanagement=&quot;yes&quot;>
<!--- TOP --->
<CFLOCK name=&quot;myAppVars&quot; timeout=&quot;3&quot;>
<CFPARAM name=&quot;application.uniqueVisitors&quot; default=0>
<CFPARAM name=&quot;application.count&quot; default=0>
<CFPARAM name=&quot;session.visited&quot; default=0>
</CFLOCK>
<cflock name=&quot;myAppVars&quot; timeout=&quot;3&quot;>
<cfif session.visited is 0>
<cfset application.uniqueVisitors = application.uniqueVisitors + 1>
<cfset session.visited = &quot;yes&quot;>
</cfif>
<cfset application.count = application.count + 1>
</cflock>

<CFOUTPUT>

<li> Unique sessions: #application.uniqueVisitors#
<li> Page hits: #application.count#

</CFOUTPUT>

<CFSET resetU = &quot;no&quot;>
<CFSET application.uniqueVisitors = iif((resetU is &quot;yes&quot;),de(0),de(application.uniqueVisitors))>

<CFSET resetVisited = &quot;no&quot;>
<CFSET session.visited = iif((resetVisited is &quot;yes&quot;),de(0),de(session.visited))>
 
Thanks!
I'll give it a shot.
Tina
 
Status
Not open for further replies.

Similar threads

Replies
3
Views
159
Replies
7
Views
184
Replies
2
Views
53
  • Locked
  • Question Question
Replies
4
Views
154

Part and Inventory Search

Sponsor

Back
Top