View Full Version : Trying to make counter
04-26-2006, 07:56 AM
i want to write a hit counter script. i record the visitor's IP in a temp DB. but when a user leaves my site, i want to delete this IP from DB. how can i get notified that visitor leave it.
that is, i want to run a script on body unload.
Please help. urgent
his has been asked here a dozen times before --> run a search for more info.
short answer: you can't catch all possible ways of users leaving your site. the closes thing you can do is update the tempDB each time the users requests a page (for instance updating a 'datetime_lastrequest' timestamp column). and then have a cron job running every X minutes that deletes all records where the datetime_lastrequest < (Now - X minutes)
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.