Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Trying to make counter

    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

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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)
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html


  •  

    Posting Permissions

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