<?
$lines = file("count/$user_login_id.php");
while (list($tmpkey,$line) = each($lines))
   {
   $line=ereg_replace("\n","",$line);
   list($result,$oldip,$ontime)=split("\t",$line);
   }
if($oldip!=$ip1||$stemp-$ontime>3000)
{
$result++;
$onzl=fopen("count/$onfile","a+");
$onw=$user_login_id."\n";
fwrite($onzl,$onw);
fclose($onzl);
}
else $result=$result;
if($stemp-$ontime<3000)$newtime=$ontime;else $newtime=$stemp;
//$online_user_time=$stemp;
$newdat=$result."\t".$ip1."\t".$newtime."\n";
$fp=fopen("count/$user_login_id.php","w+");
fwrite($fp,$newdat);
fclose($fp);

?>