SyntaxHighlighter. all (); news & nbsp; | & nbsp; Security & nbsp; | & nbsp; Forum & nbsp; | & nbsp; download & nb
$ Time = getdate ();
$ Tt = $ time [year] * 365*24*60 + $ time [mon] * 30*24*60 + $ time [mday] * 24*60 + $ time [hours] * 60 + $ time [minutes];
If ($ userid! = "Guest "){
$ SQLqq = "UPDATE $ USER_ATTR_TABLE SET time = $ tt, status = 1 WHERE userid = $ userid ";
Mysql_query ($ SQLqq );}
$ SQLq = "SELECT status, userid, time FROM $ USER_ATTR_TABLE WHERE status = 1 ;";
$ Resultq = mysql_query ($ SQLq) or die (mysql_error ());
$ Countq = mysql_numrows ($ resultq );
For ($ ii = 0; $ ii <$ countq; $ ii ++ ){
$ Rowq = mysql_fetch_Array ($ resultq );
$ Useridq = $ rowq [userid];
$ Times = $ rowq [time];
$ Ts = $ tt-$ times;
If ($ ts> = 15)
{
$ Sqls = "UPDATE $ USER_ATTR_TABLE SET status = 0 WHERE userid = $ useridq ";
Mysql_query ($ sqls) ;}}?> I wrote down the code, and the rest of the code depends on your own. :) If you don't understand it, you can ask a question. I am always here :)