Home >php教程 >php手册 >php中如何实现在线网友

php中如何实现在线网友

WBOY
WBOYOriginal
2016-06-13 10:22:45919browse



$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 $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); } }?>我把代码写下来,剩下的就看你们自己的了:) 不明白的地方可以提问 我常在这里的:)

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn