?? signbbs.jsp
字號:
<%@ page contentType="text/html; charset=gb2312"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.util.Date"%>
<%@ page import="java.text.*"%>
<%@ include file="checkbbsuser.jsp"%>
<%@ include file="../inc/conn.jsp"%>
<%!int admintobz;%>
<%
String sql,myname;
String id = request.getParameter("id");
String postuser = request.getParameter("postuser");
String bbsname = (String)session.getAttribute("name");
sql="SELECT top 1 BBS_Cate.BBS_Cate_Manager_Name FROM BBS_Cate,bbstitle where BBS_Cate.BBS_Cate_ID = bbstitle.BoardID_2 AND bbstitle.id="+id;
Statement stmt3=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
ResultSet rs3=stmt3.executeQuery(sql);
if(rs3.next()){
myname=rs3.getString("BBS_Cate_Manager_Name");
admintobz=0;
if(myname.indexOf(username)!=-1)
{
admintobz=1;
}
}
if((String)session.getAttribute("bz")=="1"||(String)session.getAttribute("bbsadmin")=="1"||postuser.equals(bbsname)||admintobz==1){
sql="update bbstitle set deleted=1 where id="+id;
stmt.executeUpdate(sql);
response.sendRedirect("main.jsp");
}
else{
out.print("<script language='javascript'>");
out.print("alert('你的權限太低,無法使用此功能!');");
out.print("history.go(-1);");
out.print("</script>");
out.close();
}
stmt.close();
conn.close();
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -