Hey, Im new to this board. I had a question i couldn't find on alot of places. I want to show the members online. Not just the number of members like show each member. It's on alot of sites, like this board too. How do I go about doing this for a site. I have PHP and MySQL. I also use cookies to store there names. Dont worry about login process. Thanks for the help!
Show "Members Online"
Every time the user interacts with the site, record the time that they do so.
Then, when you're wanting to show who's online, list those whose last interactions are less than [use your judgment here] minutes old. Any older, and you assume they've left (if they leave and don't tell you, you have no way of knowing it).
If you give them the option of deliberately logging out (so that they can tell you you're leaving), set that time to something way in the past when they do so.
That's about the best you can do, given that http (deliberately) doesn't keep track of site visitors from instant to instant to see if they're still there.
Thanks that helped out, now back to my code......
Basically just keep the time(); there on a page. If they can logout. Then have something maybe that'll delete everything inserted from that user..
Just another suggestion.. Save you from thinking how am i gonna change the time then get them to delete it..
But the concept stays the same to the way Weedpacket said
Thanks for that too, I forgot about time(); so basically ill just subtract acouple of hours when they logoug.
cya :p
Well you can use mySQL, flatfiles or session:
MYSQL:
http://www.evilwalrus.com/viewcode/484.php
http://www.evilwalrus.com/viewcode/264.php
http://www.evilwalrus.com/viewcode/497.php
SESSION:
http://www.tutorialforums.com/showthread.php?s=&threadid=23310
FLATFILE:
http://www.tutorialforums.com/showthread.php?s=&threadid=25617#post208801
hope to help
++ckill3r