Page 1 of 1

Concurrent Users

Posted: Tue Jun 20, 2006 10:06 am
by mmcoolkid94
Can anyone help me with a code to show how many users are on at once?
*I got nothing :? *

Posted: Tue Jun 20, 2006 10:18 am
by Grim...
Have a bit of included code on each page that updates a field in their row of the user table to show the time they were last active.
Then have something like

Code: Select all

$time = $timenow - $five_minutes //or whatever

Code: Select all

SELECT * FROM users WHERE active_date > $time
Hint: I like to use mktime() to get the epoch time, store that, and just use

Code: Select all

$time = mktime() - 300; //five minutes ago

Posted: Tue Jun 20, 2006 10:48 am
by RobertGonzalez
I think the word you want is 'Concurrent', not 'Congruent', though I could be mistaken.

To answer you question, when I set up my user table I uisually include a field for logged_in. This is used to support DB sessions for the user and can easily be adapted to check the count of users that are logged in...

Code: Select all

<?php
$sql = "SELECT COUNT(user_id) AS users_online FROM user_table WHERE user_logged_in = 1";
?>

Posted: Tue Jun 20, 2006 9:04 pm
by tecktalkcm0391
You must mean concurrent users if so please change it in your title ...
is this something your looking for?: http://www.tutorialized.com/forum/viewtopic.php?t=46

if not how about: http://www.hotscripts.com/Detailed/23850.html
that page is a little confusing it trys to take you here:
http://www.ridwank.com/index.php?script=6 and you can download the script here: http://ridwank.host.sk/download/ preview it here: http://www.ridwank.com/script/whosonline/whosonline.php


i know your new, and not to be rude, but next time try googleing... php + what you want to look for before you post a message. :D :D

Chris

Posted: Wed Jun 21, 2006 7:52 pm
by mmcoolkid94
Is there a way so I can see where the Ip Adress is coming from like a map of the World with little dots of every Computer.

Posted: Wed Jun 21, 2006 7:57 pm
by Weirdan
Is there a way so I can see where the Ip Adress is coming from like a map of the World with little dots of every Computer.
It's not an easy task I guess... though one could use geoip together with google maps.

Posted: Sun Jun 25, 2006 10:48 pm
by tecktalkcm0391
Hey,

http://webmonkey.wired.com/webmonkey/04 ... rogramming

Would be another tutorial I found that might be something like it. And try google maps API for the dot thing.