If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Counter for webpage

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-04-04, 10:15
NewfieBullet NewfieBullet is offline
Registered User
 
Join Date: Mar 2004
Posts: 51
Smile Counter for webpage

I have a webpage made and wanted to insert a counter, any suggestiions on where to start.


NewfieBullet
Reply With Quote
  #2 (permalink)  
Old 08-04-04, 15:38
gyuan gyuan is offline
Registered User
 
Join Date: Dec 2003
Posts: 454
Is the counter used to store the number of viewing the page? More details.
Reply With Quote
  #3 (permalink)  
Old 08-05-04, 10:13
NewfieBullet NewfieBullet is offline
Registered User
 
Join Date: Mar 2004
Posts: 51
yes i have a webpage that we are piloting and wanted to see how many hits that we will recived. i like to make my own.

Newfiebullet
Reply With Quote
  #4 (permalink)  
Old 08-05-04, 17:08
Gaz2k Gaz2k is offline
Registered User
 
Join Date: Aug 2004
Posts: 7
You have two options here,

You can use the FSO Object to store the page count in a file.

Or like me who does not have access to the FSO Object due to security reasons you could create a tiny database to store the counter.
Reply With Quote
  #5 (permalink)  
Old 08-05-04, 19:53
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
a relatively standard way of managing it is to set up an application variable to record the number of hits.

Each time the page is rendered you increment the counter with a function.

Then you need to decide when and how you want to capture the count.

You could use the application onend event to write it out to file (and the application onstart to prime it) or you could use some other method. Generally I will record the count every 10 minutes or 30 minutes or similar so that if the application does not end correctly you don't loose all your counts.

Perment storage of the data could be to the file system as a basic text file or a db or something similar, but it would depend on what you have access to.

Does that help?
Reply With Quote
  #6 (permalink)  
Old 08-05-04, 22:18
gyuan gyuan is offline
Registered User
 
Join Date: Dec 2003
Posts: 454
The simple way is to set an application variable of the counter which is incremented by 1 when the page is hit:

Application("Counter") = Application("Counter") + 1

In this case, you cannot restart your IIS or your web server since it loses the number stored in application variable. You can create a specific page to view the counter.
Reply With Quote
  #7 (permalink)  
Old 08-24-04, 14:24
rweide rweide is offline
Registered User
 
Join Date: Aug 2004
Location: USA
Posts: 54
or you can read this page and try it the other way:

http://msdn.microsoft.com/library/de...ngpagehits.asp
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On