index.php
Copy CodeThe code is as follows:
<title><BR> Live Chat <BR></title>
_a.php
Copy CodeThe code is as follows:
<title><BR> Chat Room <BR></title>
$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, "". $person. "  in ". $time."  says that
". $msg."
"." \ n ");
for ($i =0; $i < $tot; + + $i) {
if ($i >50) break;
Fwrite ($fp, $oldmsg [$i]);
}
}
?>
_b.php
Copy CodeThe code is as follows:
<title><BR> Chat Room <BR></title>
$handle =fopen ("Msg.txt", "R");
$oldmsg = Array ();
while ($content = fgets ($handle)) {
$oldmsg [] = $content;
+ + $tot;
Echo $content;
}
?>
http://www.bkjia.com/PHPjc/323403.html www.bkjia.com true http://www.bkjia.com/PHPjc/323403.html techarticle The index.php Copy code code is as follows: HTML headtitle online chat/title/head!--frames--Frameset rows= "70%,*" border= "0" frame name= "top" s Rc= "_b.php" marginwidth= "0" Marginheigh ...