📄 logon.jsp
字号:
<%@ page contentType="text/html; charset=GB2312" %>
<%@ page session="true" %>
<jsp:useBean id="alogon" scope="page" class="web.Confirm">
</jsp:useBean>
<%
String message="";
if (request.getParameter("UserID")!=null&&!request.getParameter("UserID").equals(""))
{
String UserID=request.getParameter("UserID");
String Password=request.getParameter("Password");
alogon.setUserID(UserID);
alogon.setPassword(Password);
if (alogon.execute()){
session.setAttribute("UserID",UserID);
//System.out.println("logon--"+UserID);
response.sendRedirect("reader/main.jsp");
}
else {
message = "登录出错!";
}
}
%>
<html>
<link rel="stylesheet" href="style.css" type="text/css">
<head>
<title>读者登录主页</title>
<style type="">a{TEXT-DECORATION:none}</style>
<style type="text/css">
<!--
.style1 { border-color: #009900 }
-->
</style>
<script language="javascript" type="">
function checkform(){
if(document.form1.UserID.value==""){
alert("您忘了输入证件号!");
document.form1.UserID.focus();
return false;
}
if(document.form1.Password.value==""){
alert("您忘了输入密码!"):
document.form1.Password.focus();
return false;
}
return true;
}
</script>
</head>
<body bgcolor="#ffffff">
<jsp:include flush="true" page="head.jsp"></jsp:include>
<hr width="62%"/>
<p align="center"><font size="+3">读 者 登 录 </font></p>
<form name="form1" action="logon.jsp" method="POST">
<table align="center" border="1" cellpadding="1" cellspacing="0" bgcolor="00ffff ">
<tr>
<td>证件号码:</td>
<td><input type="text" name="UserID" /></td>
</tr>
<tr>
<td>个人密码:</td>
<td><input type="password" name="Password"/></td>
</tr>
<tr>
<td align="center"><input type="submit" name="submit" value="登 录" onclick="return(checkform());" /></td>
<td align="center"><input type="reset" name="reset" value="重 设"/></td>
</tr>
</table>
</form>
<p><font color="red" style="+2"><%=message %></font></p>
<%
//String msg = request.getParameter();
if(message=="logout"){
out.println("<p><font color='red'>您已退出登录</font></p>");
}
else if(message=="nologon"){
out.println("<p><font color='red'>您还未登录</font></p>");
}
%>
<hr width="62%"/>
<jsp:include flush="true" page="footer.jsp"></jsp:include>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -