📄 superlog.jsp
字号:
<%@ page session="true" %>
<%@ page contentType="text/html;charset=gb2312" %>
<%@ include file="incdb.jsp"%>
<jsp:useBean id="reg" class="test.bbsreg" scope="page"/>
<jsp:useBean id="board" class="test.bbsboard" scope="page"/>
<%
String B1=request.getParameter("B1");
boolean yesorno;
String strSQL,whereTo,tempSTR;
java.sql.ResultSet sqlRst;
String tt,sel,boardname,boardmaster,masterpwd;
int i,boardid;
byte[] tmpbyte;
tt=request.getParameter("tt");
if (tt==null) {
tt="";
}
%>
<%if (B1!=null){
session.putValue("superlogin","false");
boardmaster=request.getParameter("boardmaster");
masterpwd=request.getParameter("masterpwd");
tempSTR=request.getParameter("boardid");
boardid=java.lang.Integer.parseInt(tempSTR);
boardmaster=boardmaster.trim();
masterpwd=masterpwd.trim();
whereTo="";
if ((boardmaster==null)||(masterpwd==null)) {
tt="username or password is empty,please login again!" ;
whereTo="superlog.jsp?tt="+tt;
}else{
tmpbyte=boardmaster.getBytes("ISO8859_1");
boardmaster=new String(tmpbyte);
if (board.checkBoardMaster(boardid,boardmaster,masterpwd)){ //'正确登录
session.putValue("superlogin","true");
whereTo="bbslist.jsp?method=8&boardid="+boardid;
}else {
tt="username or password is wrong!!!";
whereTo="superlog.jsp?tt="+tt;
}
}//end if boardmast=null masterpwd==null
%>
<script language="JavaScript">
window.location="<%=whereTo%>";
</script>
<%} //'END IF b1%>
<html>
<head>
<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>论坛管理</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 check_input(theForm)
{
if ((theForm.boardmaster.value == "")|(isspacestring(theForm.boardmaster.value)))
{
alert("请输入用户名.");
theForm.boardmaster.focus();
return (false);
}
if ((theForm.masterpwd.value == "")|(isspacestring(theForm.masterpwd.value)))
{
alert("请输入密码.");
theForm.masterpwd.focus();
return (false);
}
return (true);
}
-->
</script>
</head>
<body>
<%if (B1==null){%>
<!--------------------------------------------------------------->
<div align="center">
<center>
<table border="1" width="400" bordercolorlight="#FFFFFF" bordercolordark="#000000" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<form method="POST" action="superlog.jsp" onSubmit="return check_input(this)" name="form1"><%=tt%>
<p align="center">
<select size="1" name="boardid">
<%
sqlRst=board.listBoard(1);
i=1;
while (sqlRst.next()) {
if (i==1) {
sel="selected";
}else{
sel="";
}
boardid=sqlRst.getInt("boardid");
boardname=sqlRst.getString("boardname");
%>
<option value="<%=boardid%>" <%=sel%>><%=boardname%></option>
<%
i++;
} //end while
sqlRst.close();
%></select>
<p align="center">用户:<input type="text" name="boardmaster" size="20"></p>
<p align="center">密码:<input type="password" name="masterpwd" size="20"></p>
<p align="center"><input class="buttonface" type="submit" value="确定" name="B1">
<input class="buttonface" type="reset" value="重写" name="B2"></p>
</form>
</td>
</tr>
</table>
</center>
</div>
<!--------------------------------------------------------------->
<%}%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -