?? admin_del_bbs_action.jsp
字號:
<%@ page language="java" contentType="text/html; charset=GBK"
pageEncoding="GBK"%>
<%@page import="java.util.*,java.io.*,java.sql.*"%>
<%@ include file="../conn.jsp"%>
<%
request.setCharacterEncoding("GBK");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
</head>
<body>
<%
String username = "";
int permission = 0;
if ((null != session.getAttribute("adminlogin"))
&& (null != session.getAttribute("permission"))) {
username = session.getAttribute("adminlogin").toString();
permission = Integer.parseInt(session
.getAttribute("permission").toString());
try {
String strDo = "";
String id = request.getParameter("id");
if (id.equals("")) {
response.sendRedirect("../error.jsp");
} else {
strDo = "SELECT * FROM " + tbbs + " WHERE id='" + id
+ "'";
System.out.print(strDo + "\n");
rs = stmt.executeQuery(strDo);
if (rs.next()) {
rs.close();
strDo = "DELETE FROM " + tbbs + " WHERE id='" + id
+ "'";
System.out.print(strDo + "\n");
stmt.executeUpdate(strDo);
//刪除帖子回復數據
strDo = "DELETE FROM " + treply + " WHERE postid='"
+ id + "'";
System.out.print(strDo + "\n");
stmt.executeUpdate(strDo);
response.sendRedirect("admin_all_bbs.jsp");
} else {
rs.close();
response.sendRedirect("../error.jsp");
}
}
} catch (Exception e) {
e.printStackTrace();
response.sendRedirect("../error.jsp");
} finally {
stmt.close();
conn.close();
}
} else {
response.sendRedirect("../error.jsp");
}
%>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -