聊天室php&mysql(二)


//第二页面 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> </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> </p>
<p> </p>
</body>
</html>



相关阅读:
防止别人盗链的好方法推荐
一个MYSQL操作类
FORM程序中Oracle与Access表的导入和导出
调用access报表
SQLServer 2008 新增T-SQL 简写语法
繁简字转换功能
SqlServer 2005的排名函数使用小结
Oracle体系框架及SQL语句的性能
Linux与BSD操作系统开源许可协议的差异
热修复补丁解决崩溃发作 Win 7系统蓝屏问题
mysql 数据库备份和还原方法集锦 推荐
如何使用Yum通过ISO镜像更新
建站常用13种PHP开源CMS比较
css3教程:background属性调整增强
快速导航

Copyright © 2016 phpStudy |