📄 boardmanager.jsp
字号:
<%@ page session="true" %>
<%@ page contentType="text/html;charset=gb2312" %>
<%@ include file="incdb.jsp"%>
<jsp:useBean id="board" class="test.bbsboard" scope="page"/>
<%
String tempSTR,whereTo;
byte[] tmpbyte;
int method;
String strSQL;
java.sql.ResultSet sqlRst;
int boardid,boardhits,boardtopics;
String boardname,boardmaster,masterpwd,masteremail,masterword;
tempSTR=(String)session.getValue("adminlogin");
if (tempSTR!="true") {
%>
<jsp:forward page='adminlog.jsp'/>
<%
}
tempSTR=null;
tempSTR=request.getParameter("method");
if (tempSTR==null){
method=0;
}
else
{
method=java.lang.Integer.parseInt(tempSTR);
}
//'
//'method=4 显示增加论坛表格
//'method=5 显示修改删除论坛表格
//'method=6 退出论坛管理
//'
//'method=1 为增加论坛
//'method=2 为修改论坛
//'method=3 为删除论坛
%>
<%
if (method==6) {
//'method=6 退出论坛管理
session.putValue("adminlogin","false");
%>
<jsp:forward page='adminlog.jsp'/>
<%} //'end if method==6;%>
<%
if (method==1) {
//'method=1 为增加论坛
boardname=request.getParameter("boardname");
boardmaster=request.getParameter("boardmaster");
masterpwd=request.getParameter("masterpwd");
masteremail=request.getParameter("masteremail");
masterword=request.getParameter("masterword");
boardname=boardname.trim();
boardmaster=boardmaster.trim();
masterpwd=masterpwd.trim();
masteremail=masteremail.trim();
tmpbyte=boardname.getBytes("ISO8859_1");
boardname=new String(tmpbyte);
tmpbyte=boardmaster.getBytes("ISO8859_1");
boardmaster=new String(tmpbyte);
tmpbyte=masterword.getBytes("ISO8859_1");
masterword=new String(tmpbyte);
boardhits=0;
boardtopics=0;
if (!board.checkBoardName(boardname)) {
//'重名
%>
<%whereTo="boardmanager.jsp?method=4";%>
<jsp:forward page='<%=whereTo%>'/>
<%
}else { //'end if
board.setBoardName(boardname);
board.setBoardMaster(boardmaster);
board.setBoardMasterpwd(masterpwd);
board.setBoardMasterword(masterword);
board.setBoardMasteremail(masteremail);
board.setBoardHits(boardhits);
board.setBoardTopics(boardtopics);
board.newBoard();
%>
<jsp:forward page='boardmanager.jsp?method=0'/>
<%
}// end else
} //'End if (method==1) {
if (method==2) {
//'method=2 为修改论坛
tempSTR=request.getParameter("boardid");
boardid=java.lang.Integer.parseInt(tempSTR);
boardmaster=request.getParameter("boardmaster");
masterpwd=request.getParameter("masterpwd");
masteremail=request.getParameter("masteremail");
masterword=request.getParameter("masterword");
boardhits=0;
boardtopics=0;
//boardname=boardname.trim();
boardmaster=boardmaster.trim();
masterpwd=masterpwd.trim();
masteremail=masteremail.trim();
//tmpbyte=boardname.getBytes("ISO8859_1");
//boardname=new String(tmpbyte);
tmpbyte=boardmaster.getBytes("ISO8859_1");
boardmaster=new String(tmpbyte);
tmpbyte=masterword.getBytes("ISO8859_1");
masterword=new String(tmpbyte);
board.setBoardMaster(boardmaster);
board.setBoardMasterpwd(masterpwd);
board.setBoardMasterword(masterword);
board.setBoardMasteremail(masteremail);
board.updateBoard(boardid);
%>
<jsp:forward page='boardmanager.jsp?method=0'/>
<%} //'End if method==2%>
<%
if (method==3) {
//'method=3 为删除论坛
tempSTR=request.getParameter("boardid");
boardid=java.lang.Integer.parseInt(tempSTR);
board.delBoard(boardid);
%>
<jsp:forward page='boardmanager.jsp?method=0'/>
<%} //'End if METHOD==3%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
<link rel="stylesheet" type="text/css" href="bbs03.css">
<script Language="JavaScript">
<!--
function isspacestring(mystring)
//是否为空格字符串;true为空,FALSE为非空
{ var istring=mystring;
var temp,i,strlen;
temp=true;
strlen=istring.length;
for (i=0;i<strlen;i++)
{
if ((istring.substring(i,i+1)!=" ")&(temp))
{ temp=false; }
}
return temp;
}
function firstisspace(mystring)
//检查首字母是否是空格,TRUE首字母为空格;FALSE首字母不为空格
{ var istring=mystring;
var temp,i;
temp=true;
if (istring.substring(0,1)!=" ")
{ temp=false; }
return temp;
}
function isemail(mystring)
{
var istring=mystring;
var atpos=mystring.indexOf("@");
var temp=true;
if (atpos==-1) //email中没有@符号;不正确的EMAIL
{
temp=false;
}
return temp;
}
function check_input(theForm)
{
if ((theForm.boardmaster.value == "")|(isspacestring(theForm.boardmaster.value)))
{
alert("请输入版主.");
theForm.boardmaster.focus();
return (false);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -