📄 edittopic_check.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<<jsp:useBean id="connManager" scope="application" class="bbs.ConnManager" />
<%
Connection con = connManager.getConnection("mysql");
if(con==null)
{
%>对不起,现在数据库忙,请稍后再试<%
}
Statement stmt = con.createStatement();
request.setcharacterEncoding("gb2312");
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
stmt.close();
connManager.releaseConnection("mysql",con);
<body>
<%
String Title=new String(request.getParameter("title").getBytes("ISO8859_1"),"GBK");
String Content=new String(request.getParameter("content").getBytes("ISO8859_1"),"GBK");
String Id=new String(request.getParameter("topicid"));
String sql = "insert (Title,Content) into topic values('"+Title+"','"+Content+"') where Id='"+Id+"';
rs =stmt.executeUpdate(sql);
rs.close;
stmt.close();
connManager.releaseConnection("mysql",con);
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -