聊天室php&mysql(二)

//第二頁面 name=”frame2.php(做為現在的主流開發語言)



<?
include “../signup/MySQL(和PHP搭配之最佳組合).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(和PHP搭配之最佳組合)_query($sql)or die(” false again”);



$sql=”update chat_user set last_time=$current_time where userid=$userid”;
MySQL(和PHP搭配之最佳組合)_query($sql) or die(“false”);

$sql=”select userid from chat_user”;
$result=MySQL(和PHP搭配之最佳組合)_query($sql)or die(“fallse”);
$online=MySQL(和PHP搭配之最佳組合)_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″>
<p id=”Layer1″ style=”position:absolute; left:9px; top:37px; width:94px; height:21px; z-index:1″>  
  <p align=”center”><font color=”#FF9999″><b>在線人數</b></font></p>
</p>
<p 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(和PHP搭配之最佳組合)_query($sql)or die(“fallse”);
  while($row=MySQL(和PHP搭配之最佳組合)_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>
</p>
<p id=”Layer3″ style=”position:absolute; left:20px; top:62px; width:74px; height:11px; z-index:3″>  
  <p align=”center”><font size=”2″ color=”#FF9999″>(<?echo $online ;?>人)</font></p>
</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>

發佈留言