I'm aiming to track all people on my site at one time, registered users is no problem as I can just use their unique id and a time() in a db, and only check users online <15mins ago. For guests though, I need a way of tracking them that would assign them each a unique id. Is it possible to get a session id number and store that in a table along with time of last action? And more importantly is this a good way to go about what I want?!
you can, and it's a great way to do it, and probably one of the only ways of doing it.
you can add their ips on a another field and as username or id can you give a name like guest or for id a id only reserved for guests. And can count like a user. on your script can you then count how many Guest or geust id is online and print it.
This my idea
Thanks for the responses. Now I'm just struggling to get the SID into my query. I'm using this...
However, when I echo it out all I get is...
$query="INSERT INTO logguest (sid,lastact) VALUES (" . strip_tags(SID) . "," . time() . ")";
INSERT INTO logguest (sid,lastact) VALUES (,1146011451)
Why is the SID constant not being given?