Damian Brown wrote:

i haven't looked into it properly yet,
but is there a way in PHP of recording
the length of time a visitor stays on
your website
i can record the entry, but i don't know how to
record the exit time

There's really no way to do this, only ways to estimate the time.


Assign each user a unique id (session_id or a username) and record the time during each request. After there are no more requests for X minutes (your choice), then consider the session terminated.

If you are using session, one possibility may be to use your own handler and write a garbage collection routine that records the "age" of the session file as it's cleaned up. You can consider the age of the session file as the time that the user was on your site.

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals – www.phparch.com




-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to