second problem:there was no session for my user email. so i created $_SESSION['SecurityAssist_UserEmail'];with security assist i added the update records for both login and logout using the new session i made, but everytime i log in it does not update my table.

////// To update session status for user table to get who is online ////////if(WA_Auth_RulePasses("Logged in to pcms2_users")){ // Begin Show Region$tm=date("Y-m-d H:i:s");$xses=$_SESSION['SecurityAssist_UserEmail'];$q=mysql_query("update pcms2_users set connected_usr='Y', tm_usr='$tm' where UserEmail='$xses'");echo $tm;echo mysql_error();}else{

}

///// ////////////// End of updating login status for who is online ///////

// Find out who is online /////////$gap=10; // change this to change the time in minutes, This is the time for which active users are collected.$tm=date ("Y-m-d H:i:s", mktime (date("H"),date("i")-$gap,date("s"),date("m"),date("d"),date("Y")));//// Let us update the table and set the status to OFF////for the users who have not interacted with////pages in last 10 minutes ( set by $gap variable above ) ///

$ut=mysql_query("update pcms2_users set connected_usr='N' where tm_usr < '$tm'");echo mysql_error();/// Now let us collect the userEmail from table who are online ////////$qt=mysql_query("select UserEmail from pcms2_users where tm_usr > '$tm' and connected_usr='Y'");echo mysql_error();

while($nt=mysql_fetch_array($qt)){}

?>

0

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.