Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2004
    Posts
    51

    Smile Unanswered: Counter for webpage

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


    NewfieBullet

  2. #2
    Join Date
    Dec 2003
    Posts
    454
    Is the counter used to store the number of viewing the page? More details.

  3. #3
    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

  4. #4
    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.

  5. #5
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    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?

  6. #6
    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.

  7. #7
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •