addcategorystep2.jsp

来自「新闻发布系统源代码 可以作为网站的模板」· JSP 代码 · 共 58 行

JSP
58
字号
<%@page contentType="text/html;charset=gb2312"%>
<%@ include file="../incoming/Common.jsp"%>
<%@ include file="../incoming/ConnectDB.jsp"%>
<%@ include file="../incoming/Check.jsp"%>
<html>
<head>
<title><%=title%>管理</title>
<link href="../incoming/style.css" rel="stylesheet" type="text/css">
<script Language="JavaScript">
function ToRootMain()
{
  top.location="RootMain.jsp"
}
</script> 
</head>
<body>
<%
		String msg="";
try
{
		String categoryname = new String(request.getParameter("categoryname").getBytes("ISO8859_1"),"GBK");
		String description = new String(request.getParameter("description").getBytes("ISO8859_1"),"GBK");
		sql1 = "INSERT INTO category(CategoryName,Description) VALUES(?,?)";
		PreparedStatement prepstmt = null;
		prepstmt=con.prepareStatement(sql1);
		prepstmt.setBytes(1,categoryname.getBytes("GB2312"));
		prepstmt.setBytes(2,description.getBytes("GB2312"));
		prepstmt.executeUpdate();
}
catch(Exception e)
{
	msg = e.getMessage();
}
%>
<table border="1" width=700 align=center cellpadding=0 cellspacing=0>
    <tr align="center" bgcolor="#CCCCCC"  height=25> 
      <td height="42"><a class="title">添加栏目</a></TD>
    </tr>
    <tr> 
      <td height="56" align="center" ><div align="right"></div><span class="text">
	  <%
	  		if(msg.equals(""))
				out.println("添加栏目成功!");
			else
				out.println("添加栏目失败!错误原因:"+msg);	
	  %>
	  </span></td>
    </tr>
    <tr> 
      <td height="36" align=center ><FONT color=#000000>
        <input name=Submit type=button value="返回栏目管理" onClick="ToRootMain()">
      </font></td>
    </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?