Topic awaiting preservation: PHP Who's Online... (Page 1 of 1) |
|
---|---|
Obsessive-Compulsive (I) Inmate From: Connecticut |
posted 01-05-2003 00:20
Hi, im new to this forum. I was wondering, how would I go about making a PHP Flat file type Visitors / Members online script? I know how to get total visitors by just counting how many sessions there are in the session_save_path(). But how can I make it count active members? Ive seen it done with MySQL, but havent seen it done with Flat file. So if anyone knows how i can do this, it would be very much appreciated to point me to the correct direction. Thanks |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 01-05-2003 18:34
Hmm shouldn't be that hard, I've seen these scripts in action but never done one personally though. |
Maniac (V) Mad Scientist with Finglongers From: Cell 53, East Wing |
posted 01-05-2003 19:52
readonlynet: I'm not sure what you are after but counting the number of sessions should give you the number of active users. See this page (and the one it links to): |
Obsessive-Compulsive (I) Inmate From: Connecticut |
posted 01-06-2003 03:39
those sites seem pretty much like what i have been finding. I have a script already that can find how many people are currently at the site. But i want it so when a user logs in, it records the person and when the person is idleing or exits his browser, it will delete him from the file. So this way i can make it say something like, "Currently XX visitors and XX members are online." |
Obsessive-Compulsive (I) Inmate From: Connecticut |
posted 01-06-2003 03:58
After reading that example that I just posted, im getting more sence of how it works. The script checks if you have a cookie ( in this case i do ), and then it adds you to the database. If you dont have a cookie, it writes it to the database saying your a guest. Then you use if then to see if $user is not equal to guest and adds 1 to the members variable. Else, Adds 1 to the guests variable. |
Paranoid (IV) Inmate From: 127.0.0.1 |
posted 01-06-2003 04:30
Here's how I do it via MySQL - you should be able to convert to flat file easily: |
Obsessive-Compulsive (I) Inmate From: Connecticut |
posted 01-06-2003 14:43
Thanks for that code, seems to be a very good simple one. I will try to turn it into flat file. Thats a good idea too with the $PHP_SELF. Thanks. |
Obsessive-Compulsive (I) Inmate From: Connecticut |
posted 01-11-2003 03:24
Complete! Finally, i have did it. It took me a while. The problem i had was deleting the members thats not active in 5 minutes. so then i learned a different way of deleting in flat file by using arrays with unset(); |
Bipolar (III) Inmate From: Victoria, BC |
posted 01-16-2003 18:21
yes please, email it to me... |