php - How to grab users on the same page in a session and list them? -


on page created chat room works if you're signed forums. grabs session username who's on page , shows name when send chat. messages sent , stored , sent out via .txt file using ajax , processed php. no database (as of yet).

i'm wondering how can grab & list current users on page chatting? i'm not php bit complicated me.

my guess log username database, , whoever logged displayed... close?

try this

<?php   session_start();  echo "<pre>";  print_r ($_session); echo "</pre>";   //echo single entry  echo $_session['username']; ?> 

foreach loop through ($_session) show session data..

foreach ($_session $key=>$val)     echo $key." ".$val; 

Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -