聊天室phpmysql(二)

//第二页面 name="frame2.php"



<?
include "../signup/mysql.php";
header("Expires: Sun, 28 Dec 1997 09:32:45 GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Content-Type: text/html; charset=${Charset}");



$current_time=time();
$delete_time=$current_time-40;
$sql="delete from chat_user where last_time<".$delete_time;
mysql_query($sql)or die(" false again");



$sql="update chat_user set last_time='$current_time' where userid='$userid'";
mysql_query($sql) or die("false");

$sql="select userid from chat_user";
$result=mysql_query($sql)or die("fallse");
$online=mysql_num_rows($result);
?>

<html>
<head>
<title>user list</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Refresh" content="30; url=<? echo $PHP_SELF; ?>?userid=<?echo $userid?>">

</head>


<body bgcolor="#6699FF" text="#000000">
<div id="Layer1" style="position:absolute; left:9px; top:37px; width:94px; height:21px; z-index:1">  
  <div align="center"><font color="#FF9999"><b>在线人数</b></font></div>
</div>
<div id="Layer2" style="position:absolute; left:14px; top:96px; width:105px; height:276px; z-index:2">  
  <p><i><font size="2" color="#FF9999">

   
  <?            
  $sql="select userid,id,sex from chat_user";
  $result=mysql_query($sql)or die("fallse");
  while($row=mysql_fetch_array($result)){

      $user=$row['userid'];
      $user="<a href='https://www.jb51.net/".$PHP_SELF."?userid=".$userid."' onCLick=parent.bottom.user('".$row["id"]."')>".$row["id"];
      echo $user."</a>(".$row["sex"].")<br>";
  }
  ?>

    </font></i></p>
  <p>&nbsp;</p>
</div>
<div id="Layer3" style="position:absolute; left:20px; top:62px; width:74px; height:11px; z-index:3">  
  <div align="center"><font size="2" color="#FF9999">(<?echo $online ;?>人)</font></div>
</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>

您可能感兴趣的文章:

相关文章

最新评论

站长推荐

正版 Windows 10

正版Windows 10 家庭/专业版,操作系统限时抢购[¥1088→¥248]

站长推荐

正版 Office 软件

Microsoft Office 2016/2019/365 正版最低价仅需[ ¥148元]

大家感兴趣的内容

最近更新的内容

常用在线小工具

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/98c6094f1a5419e0a1cf7b59c1551b54.html