网页功能: 加入收藏 设为首页 网站搜索  
聊天室php&mysql(二)
发表日期:2004-07-22作者:[转贴] 出处:  

//第二页面 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='".$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>

我来说两句】 【加入收藏】 【返加顶部】 【打印本页】 【关闭窗口
中搜索 聊天室php&mysql(二)
本类热点文章
  用PHP验证邮箱是否真实有效
  PHP5的变化与PHP6展望
  用户IP、浏览器、操作系统
  oracle资料库函式库
  oracle资料库函式库
  基于PHP的聊天室(二)
  基于PHP的聊天室(二)
  php调用mysql存储过程和函数的方法
  正则表达式在网络编程中的运用
  专家预言:PHP将比Java更受欢迎
  高效的中文字符串截取函数
  高效的中文字符串截取函数
最新分类信息我要发布 
最新招聘信息

关于我们 / 合作推广 / 给我留言 / 版权举报 / 意见建议 / 广告投放  
Copyright ©2003-2024 Lihuasoft.net webmaster(at)lihuasoft.net
网站编程QQ群   京ICP备05001064号 页面生成时间:0.0112