<form name="form2" method="post" action="check.php">
<div style="margin:5px 0 0 5px;">
标题:
<input type="text" id="title_ly"/>
</div>
<div style="margin:5px 0 0 5px;">
<textarea rows="15" cols="100" id="content_ly"></textarea>
</div>
<div style="margin:5px 0 0 5px;">
<input type="submit" name="Submit" value="发表博文" id="Sumbit" style="margin-left:45%;"/>
</div>
</form>
check.php 代码
<?php
$conn=mysql_connect("localhost","root","firely0506") or die("连接数据库服务器错误".mysql_error());
mysql_select_db("PersonalBlog",$conn) or die("数据库访问错误".mysql_error());
mysql_query("set names gb2312");
$txt_title = @$_POST['title_ly'];
$txt_content = @$_POST['content_ly'];
$sql = mysql_query("insert into article(article_title,article_content)values('$txt_title','$txt_content')");
echo "<script>alert('公告信息添加成功!');window.location.href='index.php';</script>";
mysql_free_result($sql);
mysql_close($conn);
?>
加name属性,textare也是本回答被提问者采纳