<html>
<meta http-equiv="content-type" content="text/html" charset="utf-8" />
<body style="font-size: 12px">
<?php
error_reporting(E_ALL &~E_NOTICE);
$link =@mysql_connect("localhost","root","root")
or die("Could not connect:".mysql_error());
@mysql_select_db("test");
mysql_query("set names utf8");if (!empty($_POST["1"]))
{
    mysql_query("insert into test02 set title='{$_POST['title']}',content='{$_POST['content']}'");}
if(isset($_GET['action'])&&isset($_GET['id']))
{
    mysql_query("delete from test02 where id={$_GET['id']}");
}
$rs = mysql_query('select *from test02');
 while($row = mysql_fetch_array($rs)) {
     ?>
     标题:<?php echo $row['title'] ?> <br/>
     内容:<?php echo $row['content'] ?> <br/>
     <a href="12-12-1.php?action=delete&id=<?php echo $row['id']; ?>">删除</a>
     <hr/>
<?php
 }
?>
<form method="POST" action="12-12-1.php">
    发表留言:
    <br/>
    <br/>
    标题:<input type="text" value="" name="title">
    <br/>
    <br/>
    内容:<textarea cols="20" rows="4" name="content"></textarea>
    <br/>
    <br/>
    <input value="提交" name="1" type="submit">
</form>
</body>
</html>
//POST提交有问题改用get则可以