Results 1 to 3 of 3

Thread: PHP: how to know that sombdy is viewing my page?

  1. #1
    Join Date
    Feb 2007
    Beans
    863

    PHP: how to know that sombdy is viewing my page?

    Hello,

    I have a code for a notepad online, and I would like to know is sombdy is still being seeing the webpage to know if I can work and update the page.

    I know how to check the IP of the person, but how to know that he is gone and not seeing or working on the webpage?

    Any hints are welcome

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Beans
    435
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: PHP: how to know that sombdy is viewing my page?

    all webstats are based upon the next request, they don't actually checkwhen the user is browsing a page or not, if you wanted you could acomplish this using ajax but I think you may break some privacy rules...

    to set this up you would have a ping like script in the ajax (running every few secs), then the php page being requested would update the database with info to state the webpage is being accessed by ...ip
    My personal website with blog n apps
    http://www.mikejonesey.co.uk/

  3. #3
    Join Date
    Nov 2008
    Location
    Maine
    Beans
    1,126
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: PHP: how to know that sombdy is viewing my page?

    I think the std method is to write a cookie to that persons computer and update the cookie frequently, then send the cookie data back when they navigate away. or something like that.
    ~Conradin~

Bookmarks

Posting Permissions

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