Viewing whos online?

Discussion in 'PHP' started by mokimofiki, May 26, 2009.

  1. #1
    I am working on a website that users login to use. I would like to be able to update everyone who is online's account with points when I see fit.

    If I have 200 accounts active but only 60 people are online I want to update those 60 peoples accounts with a point since they are actually online when I posted an event for them to be logged in for.

    Any help would be great thank you in advance.
     
    mokimofiki, May 26, 2009 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    Use a database for session management. Check the timestamp on the last pageview for a particular user. If it's within a certain amount of time ( a few minutes), the user was on the site.
     
    jestep, May 26, 2009 IP
  3. Chikey.ru

    Chikey.ru Peon

    Messages:
    50
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    1. you can using popular buttons, that show statistic.
    2. do as sow jestep
    3. random=)
     
    Chikey.ru, May 26, 2009 IP
  4. mokimofiki

    mokimofiki Well-Known Member

    Messages:
    444
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    130
    #4
    ok that is setup now .... (thank you btw)

    Now that I have the time stamp saving to the record that is associated with the user how do I call for the people logged in the last 10 minutes:

    last stored was for Moki time was 10:55:37

    mysql_query("SELECT username FROM Users WHERE ????");
     
    mokimofiki, May 26, 2009 IP
  5. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #5
    Something like this...

    mysql_query("SELECT username FROM Users WHERE timestamp_column >= DATE_SUB(CURRENT_DATE(), INTERVAL 10 MINUTES));
     
    jestep, May 26, 2009 IP