I would like to create a simple online offline status indicator that shows to browsing users if a user is online or offline. In my database I have a user tabel for every registed user I know I can simply add another colum at the end of the structure called status and have online idicated by a 1 and offline indicated by a 0. My problem is I'm very new to php and not sure how to.

A. Get the colum to update with either 1 or 0 every time a user logs on or off.

B. Get the table refresh back to 0 if a user forgets to log out and leaves the site

Can anyone give me some example code for this or does anyone have a base code to work with!

    basically wat I want is like the little dot in these forums that tells you if the user is online or offline.

      Weedpacket wrote:

      How is this significantly different from your other post?

      My other post is a online list of users on the site...

      this is on online offline status indicator that could be placed in the members profile.

        what about this:
        - on LOGIN you update the status-col of your users-table( status:1 )
        - on LOGOUT you do the same ( 0 )

        if you wanna check, whether the user is online or offline ( but forgot to logout ),
        you have to check the last access-date ( date of last page viewed ) somehow ...
        by adding a second col( time ) to the user-table ....

        afterwards you can do an update on all rows, that are status-online and last page-viewed
        an hour ago( or so )

          Write a Reply...