您现在的位置: 无忧电子商务网 >> 信息学院 >> 程序开发 >> php >> 正文

判断在线用户的方法

作者:佚名    信息学院来源:整理    点击数:    更新时间:2008-2-2 我要参与讨论

  mt);
 $stmtc = ociparse($conn, "insert into tb_onlineusercount (n_onlineid,n_onlineuserid,d_logindate,d_logintime) values ($intonlineid,$intonlineuserid,$datlogindate,$datlogintime)");
 ociexecute($stmtc);
 header("location:index.php"); //成功登陆!
}//whileover
}//end if
}//while_over
}//end if
}//while_over

?>
<?ob_end_flush();?>
/*-------checksession-----检查刷新程序---*/
<?
/*30分钟刷新程序
先统计出在线的用户数,如果没有在线用户,系统要保证一个系统指定用户。该系统用户时时在线的原因是保证该刷新程序的执行
如果该登陆用户session不存在了,表示用该用户离线。统计出时间。
*/
session_start();
require('oracle8conn.php');
print $objsnickname;
?>
<html><head><meta http-equiv=refresh content='1800;url="checksession.php"'>
<?
$nowdate = date("y-m-d");
$nowdate = "to_date('".$nowdate."','yy/mm/dd')";
$nowtime = time();
//统计在线人数。30分钟更新一次
$stmtcount = ociparse($conn,"select count(*) from tb_onlineuser");
ociexecute($stmtcount);
while(ocifetchinto($stmtcount,&$arrcountuser)){
$countuser=$arrcountuser[0];
}
print "目前在线人数为:".$countuser."<br>";
//判断在线否?
if ($countuser==0){
 print "没有人在线!特殊处理!";
}else{
$stmtonlineuser = ociparse($conn,"select n_onlineuserid,d_logintime,n_onlineid from tb_onlineuser");
ociexecute($stmtonlineuser);

上一页  [1] [2] [3] [4] [5] [6] 下一页

在google里搜索更多判断在线用户的方法

Google
Web www.51ec.org
  • 上一篇信息学院:

  • 下一篇信息学院:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    我来说两句 对此文章发表了评论
      昵 称: *必填    ·注册用户·
      评 分: 1分 2分 3分 4分 5分     严禁发表危害国家安全、政治、黄色淫秽等内容的评论,用户需对自己在使用本网站服务过程中的行为承担法律责任。本站管理员有权保留或删除评论内容,评论内容只代表机友个人观点,与本网站立场无关。  
    评 论
    内 容

     
    评论列表 (最新 评论仅限网友观点!)

    供求信息




    | 设为首页 | 加入收藏 | 关于我们 | 广告服务 | 联系方式 | 友情链接 | 版权申明