<?php
 header("content-Type: text/html; charset=gb2312");
 include_once("DBHelper.php");
?> 
<!--==========业务逻辑==========-->
<?php
 $conn = new ADOConnection;
 $conn -> PConnect("localhost","root","weoffice","eoffice");//数据库连接
 $conn -> SetUnicode("set names gb2312");//**设置字符集***
 //比系统登录时间延迟6分钟
 $onlineNum = $conn -> ExecuteQuery("SELECT count(*) as nums
  FROM user_online
  WHERE VISIT_TIME >= date_sub( now( ) , INTERVAL 10
  MINUTE )");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>无标题文档</title>
<meta http-equiv="content-type" content="text/html" charset="gb2312" />
<link href="css/style.css" type="text/css" rel="stylesheet" />
</head>

<body style="text-align:center; margin-top:150px;">
    <h3>当前在线人数:<span style="color:#ff0000;"><?php echo $onlineNum[0]["nums"]; ?></span></h3>
</body>
</html>
<?php
$conn -> ConnClose();
?>

相关文章:

  • 2022-01-12
  • 2021-11-21
  • 2021-12-23
  • 2022-01-16
  • 2021-09-04
  • 2022-01-05
  • 2022-12-23
  • 2022-01-15
猜你喜欢
  • 2021-11-22
  • 2022-12-23
  • 2022-01-06
  • 2021-09-30
  • 2021-07-07
  • 2021-12-05
  • 2022-12-23
相关资源
相似解决方案