代码如下:
post.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>提交你的回复</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<link href="main.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #EEEEEE}
-->
</style></head><body><center><br><br><br><form name="form2" action="reply.php" method="post">
<table width="358" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr bgcolor="#E7E7E7">
    <td height="21" colspan="3" valign="middle">填写你的回复</td>
  <tr>
    <td width="57" height="172" align="left" valign="middle">comment</td>
    <td colspan="2" valign="top"><textarea name="text2" cols=40 rows=12 class=comment id="text2"></textarea></td>
    
    <tr>
      <td height="17" align="left" valign="bottom">name    </td>
  <td width="122" valign="middle" align="left"><input name="name2" type="text" class="text" id="name2" size=12>    </td>
  <td width="177" valign="top"><input name="act" type="hidden" id="flag" value="<?php $id=$_REQUEST["id"]; echo $id?>"> </td>
    <tr>
      <td height="35" colspan="3" align="center" valign="middle">        <input type=image src="./IMAGE/POST.GIF" name="sub1" onClick="javascript:form2.submit()"></td>
        </table>
</form>
</center>
</body>
</html>reply.php:
<title>回复留言</title><?php 
include("./config.php");
$iden=$_REQUEST["act"];
$name=$_REQUEST["name2"];
$text=$_REQUEST["text2"];
$link=mysql_connect($servername,$dbusername,$dbpassword);
mysql_select_db($dbname,$link);
$query="insert into bbsdata (name,qq,msn,mail,text,iden) values ('$name',NULL,NULL,NULL,'$text','$iden')";
$result=mysql_query($query,$link);
if ($result)
    {
 echo "<div align=center>回复成功</div>";
 }
 else {
       echo "<div align=center>回复失败</div>";
   }
   mysql_close();
   echo "<br><div align=center><a href=index.php>返回</a></div>";
?>
代码就是上面的了.