All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
浅谈数据库设计技巧(下)_mssql学习_编程技术
三个SQL视图查出所有SQL Server数据库字典_[SQL Server教程]
ASP.NET技巧:HTTP性能调优之设置连接失效时间_.net资料_编程技术
ASP.net2.0统计图表_[Asp.Net教程]
简单示例:AJAX结合PHP代码实现登录_[PHP教程]
如何利用PHP+MYSQL保存和输出文件_php资料_编程技术
PHP项目将联合起来转向PHP5_php资料_编程技术
ASP.NET2.0下含有CheckBox的GridView删除选定记录实例_[Asp.Net教程]
c#中连接SqL2005数据库错误解决及转义字符_.net资料_编程技术
经典正则表达式,(收藏整理)_JavaScript技术_编程技术
Reading number is top 10 pictures
So beauty, will let you spray blood3
China's zhejiang university to create the world's most light material
A man's favorite things2
好身材能把衣服穿出3D效果
乳娘帕梅拉安德森3
战场废物1
西游四格漫画(五)
胸部遭到偷窥的女人们
Absolutely shocked. National geographic 50 animal photographys6
青春清纯美女大集合3
Download software ranking
终极变速大师Speeder3.26
XML+Web+Service开发教程
jdk1.5
WebService在.NET中的实战应用教学视频 → 第5集
Proficient in Eclipse
Tram sex maniac 2 (H) rar bag10
apache-tomcat-6.0.33
SQL2000 For 4IN1
JSP+Ajax Web development typical examples
C#编程思想
aaa published in(发表于) 2013/12/24 5:50:05 Edit(编辑)
PHP实例:精确到每一秒钟的在线人数显示代码_php资料_编程技术

PHP实例:精确到每一秒钟的在线人数显示代码_php资料_编程技术

PHP实例:精确到每一秒钟的在线人数显示代码_php资料_编程技术-你的首页-uuhomepage.com


session_start();
$dat_now1=date("H+i+s");//取时间
$p2=explode("+", $dat_now1);
$dat_number1=$p2[0]*3600+$p2[1]*60+$p2[2];//取秒

if($online_time<>"")//上次刷新时间
{$dat_h=substr($online_time,11,2);
$dat_i=substr($online_time,14,2);
$dat_s=substr($online_time,17,2);
$dat_number=$dat_h*3600+$dat_i*60+$dat_s;
}

$tmptime=$dat_number1-$dat_number;//上次到现在的间隔秒数
if(session_is_registered(username)&&(($tmptime>300)¦¦($tmptime<0)))//如果不到5分钟
{
$online_time=date("Y-m-d H:i:s");
$str="replace lt_t_online set lt_username='$username',lt_lasttime=now()";//写入数据库
$res=mysql_query($str);
}
?>
以上文件每分钟自动刷新一次
以下是5分钟运行一次的守护进程
$str = "delete from lt_t_online where UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(lt_lasttime)>300";
mysql_query($str);
?>





添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.