<%@ page contentType="text/html;charset=GBK" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>留言本</title>
</head>
<jsp:useBean id="db" scope="session" class="myBean.DBConnection" />
<body>
<%
	String pid = request.getParameter("pid");
	if(pid==null) {
		out.print("不要乱来");
		return;
	}
	String title = db.convertDB(db.convertGBK(request.getParameter("title")));
	String msg = db.convertDB(db.convertGBK(request.getParameter("msg")));

	String sql = "insert into msg(pid, title, content) values(" +pid+", '"+ title +"','" +msg+"')";
	if(db.execModify(sql)==1)
		out.print("<h1>留言成功<h1>");
	else {
%>
		<h1>数据库错误</h1><a href="list_msg.jsp">返回</a>
<%
		return;
	}
%>
<a href="list_msg.jsp">查看</a>
</body>

</html>