![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Mar 2002
Posts: 8,234
|
Coders! Question for ya...
Is it possible to create a REAL-TIME User's Online script that doesn't use a time interval?
My site uses php sessions and I want to create a user's online script - but I want it to be as real-time as possible. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: May 2004
Location: San Diego, CA
Posts: 1,007
|
Sure why not?... it's just session tracking.
If you get a lot of traffic you are going to bog down your site running queries for something sorta silly though. IMO anyway. T
__________________
I like ducks. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Jul 2004
Posts: 309
|
This is silly easy. In your config (or any file thats included in the main script thats setting the sessions) set the sessions dir using a set ini at the top. then do a dir listing on the dir every 30 seconds on a cron or other c app or something (you CAN do it on every load but thats just a server load problem) and count the number of sessions. so long as your php is cleaning up the old sessions quickly, it will return a good number. if you dont have any other sessions apps on your machine (check to make sure in php.ini that its not automatically starting sessions) you can even count the decault dir and not have to set ini it.
|
![]() |
![]() ![]() ![]() ![]() ![]() |