>/online_text.php?nick=<>">' * * then you can check the variable 'chatter_online' if the nick is on the chat * * E.G.: * if (chatter_online==1) document.writeln("USERON") else document.writeln("USEROFF"); */ $now = gmdate("D, d M Y H:i:s")." GMT"; Header("Date: $now"); Header("Expires: $now"); Header("Last-Modified: $now"); Header("Pragma: no-cache"); Header("Cache-Control: no-store, no-cache, max-age=0, must-revalidate"); Header("Content-Type: text/html"); include "defaults_inc.php"; /* * Open a database connection * The following include 'returns' a database identifyer '$db_handle' * for some database querys. */ include ("connect_db_inc.php"); $db_handle=connect_db($DATABASEHOST,$DATABASEUSER,$DATABASEPASSWD); if(!$db_handle){ exit; } $nick=str_replace("_"," ",$nick); $result=mysql_query("SELECT Nick FROM chat WHERE Nick='$nickname' limit 0,1",$db_handle); /* * If the user is online return 'var chatter_online=1' else * return 'var chatter_online=0' */ if(mysql_num_rows($result)==1){ printf("document.write('anwesend');"); }else{ printf("document.write('abwesend');"); } mysql_close($db_handle); exit; ?>