<?
$a=mysql_connect( "localhost" , "root" , "" );
$b=mysql_select_db("wb");
$c="INSERT INTO chatroom ( mes)VALUES ('$_POST[mes]');";
$d=mysql_db_query("wb",$c);
?>
<table width="400" align="center" bgcolor="#FFCCCC">
<tr>
<th bgcolor="#FFFF99" scope="row">
<form name="form2" method="post" action="<?=$PHP_SELF;?>">
<label>
<div align="left">
<?
$a=mysql_connect( "localhost" , "root" , "" );
$b=mysql_select_db("wb");
$c="select * from chatroom order by id DESC limit 0,10";
$d=mysql_db_query("wb",$c);
$row=mysql_num_rows($d);
while($result=mysql_fetch_array($d)) {
$e[] = $result[mes];}
for($i=count($e)-1;$i>=0;$i--) {
echo $e[$i]."<br>";}
?>
</div>
</label>
</form> </th>
</tr>
<tr>
<th scope="row"><form name="form1" method="post" action="">
<table width="400" border="1" cellspacing="0" cellpadding="0">
<tr>
<th width="50" scope="row"><font size="2">post</font></th>
<td width="392"><label>
<div align="center">
<input name="mes" type="text" id="mes" size="40">
</div>
</label></td>
<td width="50"><label>
<input name="Submit" type="submit" id="Submit" value="OK">
</label></td>
</tr>
</table>
</form> </th>
</tr>
</table>