Hi Tom,
What you might try is creating a script that updates the "visits" table by
one, and then use CFLOCATION to redirect to the specified #WebAddress#.
Change your anchor tag to point to this script:
<A href="scriptname.cfm?WebAddress=#WebAddress#" TARGET="bottomright">
.....and then create your scriptname.cfm:
---------------------------------------
<cfquery name="Update" datasource="dsn" maxrows="1">
UPDATE table
SET visits = visits+1
WHERE WebAddress='#WebAddress#'
</cfquery>
<cfoutput>
<cflocation URL="#WebAddress#">
</cfoutput>
--------------------------------------------
HTH,
David
-----Original Message-----
From: Tom Forbes [mailto:[EMAIL PROTECTED]]
Sent: Saturday, July 07, 2001 12:08 AM
To: CF-Talk
Subject: How do I increment counter field by clicking on link?
Help Please -
I have a database table with company information, and a field called
"Visits" -
The below link appears in the left hand frame panel. When clicked, the
visitor sees the company's web site in the right hand frame (bottomright).
<A href="http://#WebAddress#" TARGET="bottomright">#CompanyName#</a>
I want to increment the "Visits" field by one count every time the link is
clicked. I have tried many approaches, but am unable to resolve this - can
someone please help me??
Thanks very much!
Tom
*******************************************************
MedMatrix Used Medical Equipment Web Portal
http://www.medmatrix.com
V:(407) 772-3427 F:(407) 772-3428
Tom Forbes, Forbes Web Consulting, Inc.
178 S. Monterey Isle Blvd., Longwood, FL - 32779
*******************************************************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists