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

Dynamic Page Counter 1

Status
Not open for further replies.

andy98

Programmer
Jul 7, 2000
120
0
0
GB
The scenario is...

I have a database that serves up dynamic pages for different Churches. It would be no problem to store a count in a database table associated to a specific Church.

But how would I do that?

How would I go about creating a hit counter for a dynamic page. That would keep a simple count of when a specific Church Page was viewed.

I can't seem to think how it could work. If anyone has any ideas it would be appreciated.

God Bless
 
in application.cfm...

<cfset church=&quot;however you do this&quot;>

<cfquery name=&quot;updatehitcounter&quot; datasource=&quot;foo&quot;>
update hitstable
set hits = hits + 1
where church = #church#
</cfquery>

note that this will not be total page views, because of browser or ISP caching

rudy
 
Thanks Rudy

I'll give it a try

God Bless
 
You might not want to store the number of hits. If I were you, I would record a timestamp given a site/application and then use SQL query to count number of timestamps and that is your total hit. The advantage of this approach is you could estimate number of hits given a site, a time frame. In other words, you can tell how many hits on a site this week, last week, last month and so on.
 
Thanks,
It's been a while but I may try that approach soon.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top