Counting Visits To A Page

Results 1 to 2 of 2

Thread: Counting Visits To A Page

  1. #1
    Join Date
    Dec 1969

    Default Counting Visits To A Page

    i&#039;d like to count the number of times my page is visited.<BR><BR>&#060;body onload="count();"&#062;<BR><BR>something like that. i could create a count function that just keeps count of the number of times the page is loaded.<BR><BR>however, that doesn&#039;t do me much good when i want to count the number of unique visitors rather than each time the page is loaded.<BR><BR>any ideas?

  2. #2
    Join Date
    Dec 1969

    Default No way except with a DB...

    ...and even then, how will you *KNOW* that it is a new visitor unless you use a login system?<BR><BR>There&#039;s no way to identify unique users by just looking at what is normally sent from browser to server.<BR><BR>And then on top of all this, it&#039;s a moderately expensive DB operation to do this! You would have to have a table of "UserPageVisits", something like:<BR> Members<BR> MemberID<BR> MemberName<BR> etc.<BR><BR> Pages<BR> PageID<BR> other page info <BR><BR> MemberPageVisits<BR> MemberID<BR> PageID<BR><BR>And then you could do, on each page:<BR> SELECT * FROM MemberPageVisits <BR> WHERE MemberID = ###<BR> AND PageID = ###<BR>and, if you get RS.EOF, then you add a new record to that table<BR> INSERT INTO MemberPageVisits (MemberID, PageID)<BR> VALUES ( ###, ### )<BR><BR>[where the ###&#039;s are replaced by appropriate IDs, of course.]<BR><BR>In short, this will be a performance hit on the site. How big a hit? Depends on how many members you have.<BR><BR><BR>

Posting Permissions

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