This is just one way to do it (there about 1000 others) but I think its the most basic.
You could have 2 frames 1 that refreshes every 5 seconds (META refresh) that simply reads a file and outputs it
$array = file("chatlog.dat");
while ($i < sizeof($array)) {
echo $array[$i] . "<br>";
}
then you could have a bottom frame or something right to a file...
($message comes from input page as well as $username)
$input = $username . ": " . $message;
$fp = fopen("chatlog.dat", "w+");
fputs($fp, $input);
fclose($fp);
This is a really simple simple chat room, it doesnt cover errors in input and doesnt cover "garabage collection" when the file gets to big (mabye a cron job to clean out the file everynow and then just a thought). This is really basic I would check out
http://www.phpbuilder.com/columns/mhall20000621.php3
They have an article and sample of another chatroom.