Home > Backend Development > PHP Tutorial > How to implement online netizens in php_PHP tutorial

How to implement online netizens in php_PHP tutorial

WBOY
Release: 2016-07-13 17:22:18
Original
815 people have browsed it



$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); } }?>I write down the code and the rest is It’s up to you:) If you don’t understand anything, you can ask me. I’m always here:)

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/532331.htmlTechArticle$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,...
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template