CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 hit counter asp code - please help

Print topic Send  topic

Author Message
brandx


Posts: 29
Posted: 01/21/2005, 12:49 PM

Version: Codecharge studio 2.3
Platform: Windows 2000, ASP and Access

Hi all, i've spent the better part of my day searching the forum and trying to get a hit counter working with the numerous posts there are about it... but i just can get it to work....

My table name is "Content_Articles"
The primary key is "AID"
The hit count field is "counter"

Every time someone views an article "i.e. a record" from the content_articles table i want the "counter" field to increase by 1.

I've tried putting the code in the before show page event... but it doesn't increase the counter....

Can anyone help me out?

Geary
View profile  Send private message
kevind

Posts: 251
Posted: 02/01/2005, 6:53 PM

Hi Geary,

I have an app that when I click on a Business Contact in a grid it calls another page that then updates the 'last modified' field in that Contact's record in a table, then opens the contact editing page and that drives a 'hotlist' of contacts in another frame of the page/interface.

So, assuming you build a grid of articles and have a link in each article row presented that opens the article. . . . .you can do 2 things:

1) simple approach - not as classy looking
- create a page with a record form that uses the id, retrieves the current article hit count and in the before show event of the field adds 1 to that number
- in the onload page event of the page have it submit the form for you
- in the 'return page' section of the form have it then call the other page that contains the actual article

2) create some custom SQL code in the before show page event of the page that is called from the grid link that looks up the current value of the page hit (or pulls it from a passed URL value) and performs an update adding 1 to the value

There is some info on custom SQL statements in the help section of CCS - search for 'execute custom sql' and you'll find what you need


hope that helps
kevin


_________________
thanks
Kevin

======================
CCS 3.2.x / ASP / MS Access /mySQL / PHP / jQuery / jQuery UI / jQuery Mobile
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.