Chat room Php&mysql (ii) _php Foundation

Source: Internet
Author: User
Second page name= "frame2.php"



?
Include ".. /signup/mysql.php ";
Header ("Expires:sun, 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);
?>

<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?> ">



<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> online number </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;? > People) </font></div>
</div>
<p> </p>
<p> </p>
</body>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.