SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast einstien_ii's Avatar
    Join Date
    Jan 2001
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey! ya fellas,

    The same has been posted under a different category also, since I was also looking for ColdFusion, but since I am also thinking of PHP, I thought I should also have it posted here again, so do notconsider it as a repeated message!
    Can anyone tell me the logic behind Real Time User Management!

    Say, like when you have a users database in your site and if your site's users are controlled by user login and registration procedures, how can you show in real time which user is online at a particular moment when you are online and who is offline.

    For example if you look to your left :

    <<==== Look to your left at this thread to see my status

    at the sitepoint site, you can see the user's status in realtime, if online or not.

    I intend to either use PHP or ColdFusion to do this, but simply have no idea how to do it!

    Can someone explain how to do this ?

    Krishna Narayanan
    einstien_ii@zeenext.com
    http://www.talofians.net


  2. #2
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can't walk you through everything, but I'm fairly sure this is done with sessions - new to PHP4, I think.

    I've read up on sessions in ASP a bit, and the basic logic behind it (assuming it's the same for PHP), is that the server can handle a lot of the session work for you: you can create a session everytime someone loads a page with a very simple command, and tell it how many minutes it should take to expire...

    ...so basically, if you set it to 5 minutes, it will end the session if they go 5 minutes without loading any pages on your site. You use a similar command when the session ends - you keep a common, global variable in some included and/or text file, and count the number up or down when each of these commands is executed.

    I might be able to go into the actual code a bit, but that's it written in plain text. As you can see, using sessions, it wouldn't be hard to show the number of users currently logged on - targetting each one individually like this would probably be a bit trickier, though.


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
  •