Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Senior Member Andrew Yurlov's Avatar
    Join Date
    Apr 2011
    Location
    Portland, OR
    Posts
    1,306
    Member #
    27566
    Liked
    181 times
    I already put in a login system that works. Now how do I make my database show which members are online on a certain div in the website?

    site in question - http://sot.netii.net/

    Sorry if wrong section.
    Artificial intelligence is nothing compared to natural stupidity -Someone

    Design is a funny word. Some people think design means how it looks.
    But of course, if you dig deeper, itís really how it works.
    -Steve Jobs



  2.  

  3. #2
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    If you're not using a DB to authenticate users, it's not possible.

    If you authenticate users to a DB when they login, then when they do, set a session variable and set a flag on that table and call it active, set a field with the current_timestamp() variable.

    Every time a person visits a page, update the "active" flag and the time variable. Build your query to look at that table to see how many and who's active sessions are less than 10-20 minutes old or less depending on your sites session timeout variable. Usually if the user has not done anything in that timeout period, it means they are no longer active on the site.

    In ASP, if the user session dies and they return to the site, they would need to log back in and start all over again, I'm sure PHP has the same capabilities ( if not more ).

  4. #3
    Senior Member Andrew Yurlov's Avatar
    Join Date
    Apr 2011
    Location
    Portland, OR
    Posts
    1,306
    Member #
    27566
    Liked
    181 times
    Quote Originally Posted by Webzarus, post: 243008
    If you're not using a DB to authenticate users, it's not possible.

    If you authenticate users to a DB when they login, then when they do, set a session variable and set a flag on that table and call it active, set a field with the current_timestamp() variable.

    Every time a person visits a page, update the "active" flag and the time variable. Build your query to look at that table to see how many and who's active sessions are less than 10-20 minutes old or less depending on your sites session timeout variable. Usually if the user has not done anything in that timeout period, it means they are no longer active on the site.

    In ASP, if the user session dies and they return to the site, they would need to log back in and start all over again, I'm sure PHP has the same capabilities ( if not more ).
    Can you help me create this query?
    Artificial intelligence is nothing compared to natural stupidity -Someone

    Design is a funny word. Some people think design means how it looks.
    But of course, if you dig deeper, itís really how it works.
    -Steve Jobs



  5. #4
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    Do you have a table of users that you update with last login date/time and a session variable ?

  6. #5
    Senior Member Andrew Yurlov's Avatar
    Join Date
    Apr 2011
    Location
    Portland, OR
    Posts
    1,306
    Member #
    27566
    Liked
    181 times
    Quote Originally Posted by Webzarus, post: 243023
    Do you have a table of users that you update with last login date/time and a session variable ?
    Yea I think I have all of it. I will provide all the code in a private message. I need to have this done in 3 days including design. Thanks for all the help.

    Will upload everything when i get home
    Artificial intelligence is nothing compared to natural stupidity -Someone

    Design is a funny word. Some people think design means how it looks.
    But of course, if you dig deeper, itís really how it works.
    -Steve Jobs




Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 02:04 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com