delphi programming forums mysql charset mget recursive synonimos
free ventrilo servers hosting cs javascript delay python find in list
Back Forum New
abstract:

  I am thinking about creating something in ColdFusion where each time someone clicks on the word document I would have a link parameter increase a counter in the database field.  Please advise if someone has any other suggestions or ideas on how to handle this?


I need to count how many times a word document link is clicked on for my web page.  I am thinking about creating something in ColdFusion where each time someone clicks on the word document I would have a link parameter increase a counter in the database field.  Please advise if someone has any other suggestions or ideas on how to handle this?

TOP

Create a tbl with a field called counter. On the link, <a>, implement a jquery.click function which will make an ajax call to a cfm page that will get the counter, and output that counter. On ajax success, just display the output with the div.html().

TOP

here is an example:
http://fuzzysiberians.com/cfm/hcTest.cfm
this page makes an ajax call to a page called hitCount.cfm. In this page:
Code:
  1. <cfif not isDefined('session.hitCount')>
  2.         <cfset session.hitCount = 0>
  3. </cfif>
  4. <cfset session.hitCount = session.hitCount + 1>
  5. <cfoutput>#session.hitCount#</cfoutput>
Copy Code
of course, you want to replace this with your db stuff.



  I am thinking about creating something in ColdFusion where each time someone clicks on the word document I would have a link parameter increase a counter in the database field.  Please advise if someone has any other suggestions or ideas on how to handle this?

TOP

Back Forum