国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 開(kāi)發(fā) > PHP > 正文

php寫(xiě)的簡(jiǎn)易聊天室代碼

2024-05-04 23:18:35
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
index.php

復(fù)制代碼 代碼如下:


<html>
<head><Title>
在線(xiàn)聊天
</title></head>
<!-- frames -->
<frameset rows="70%,*">
<frame src="_b.php" marginwidth="0" marginheight="0" scrolling="yes" FRAMEBORDER="NO" noresize>
<frame src="_a.php" marginwidth="0" marginheight="0" scrolling="no" frameborder="no" noresize>
</frameset>
<body>
</body>
</html>


_a.php

復(fù)制代碼 代碼如下:


<html>
<title>
聊天室
</title>
<body TOPMARGIN=0 LEFTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 >
<?php
$person = @$_POST[person];
$msg = @$_POST[message];
if ($person!="" && $msg!=""){
$handle = fopen("msg.txt","r");
$tot = 0;
$oldmsg = array();
while ($content = fgets($handle)){
$oldmsg[] = $content;
++$tot;
}
fclose($handle);
unlink("msg.txt");
$fp = fopen("msg.txt","a+");
$time = date("h:i");
fwrite($fp,"<font color=/"blue/">".$person."</font> in <font color=/"red/">".$time."</font>  says that  <b>".$msg."</b><br>"."/n");
for ($i =0;$i<$tot;++$i){
if ($i>50) break;
fwrite($fp,$oldmsg[$i]);
}
}
?>
<TABLE cellspacing="0" cellpadding="0">
<tr bgcolor="#666666">
<td>
</td></tr>
<tr bgcolor="#FFCC66">
<td ></td>
</tr>
</TABLE>
<table border=0 cellspacing=0 cellpadding=0 bgcolor="#EFEFEF">
<tr bgcolor="#666666">
<td>
<table boder=0 cellspacing=0 cellpadding=0 bgcolor="#EFEFEF">
<tr>
<td valign="top">
<font size="-1" color="#666666">

<table width = "100%" border = "0">
<tr>
<form action="_a.php" method = "post">
<td>
<font size="-1">昵稱(chēng):</font>
<input type="text" size="12" maxlength="80" value="<?php echo $person;?>">
<br>
<font size="-1"></font>
<textarea type="textarea" rows="9" cols="150" size = 100></textarea>
<input type="submit" value="發(fā)言">
</td>
</form>
</tr>
</table>
</font>
</td>
</tr>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>


_b.php

復(fù)制代碼 代碼如下:


<html>
<head>
<title>
聊天室
</title>
</head>
<META HTTP-EQUIV=Refresh CONTENT="5; URL=_b.php">
<body bgcolor="#EFEFEF">
<?php
$handle=fopen("msg.txt","r");
//$oldmsg = array();
while ($content = fgets($handle)){
//$oldmsg[] = $content;
//++$tot;
echo $content;
}
?>
</body>
</html>


php寫(xiě)的簡(jiǎn)易聊天室代碼

發(fā)表評(píng)論 共有條評(píng)論
用戶(hù)名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 南川市| 湟源县| 色达县| 咸宁市| 小金县| 太保市| 汨罗市| 南皮县| 资溪县| 陇川县| 吉安市| 长阳| 商丘市| 鸡泽县| 长乐市| 平乡县| 马鞍山市| 大石桥市| 蓬溪县| 大新县| 图木舒克市| 静乐县| 栖霞市| 彭水| 常州市| 绩溪县| 乌拉特前旗| 盐城市| 兰考县| 阳山县| 兴国县| 湘乡市| 郎溪县| 页游| 怀化市| 平昌县| 当阳市| 江达县| 阿克| 二连浩特市| 安平县|