⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_del_reply_action.jsp

📁 自己编写的jsp+mysql论坛系统,带后台系统.不是很完善,但是功能是完整的
💻 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 " + treply + " WHERE id='" + id
								+ "'";
						System.out.print(strDo + "\n");
						rs = stmt.executeQuery(strDo);
						if (rs.next()) {
							rs.close();
							strDo = "DELETE FROM " + treply + " WHERE id='" + 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 + -