📄 adminlogin.jsp
字号:
<%@ include file="admintop.jsp"%>
<link rel="stylesheet" type="text/css" href="news.css">
<%request.setCharacterEncoding("GB2312");
String addtype=request.getParameter("action");
if(addtype==null){
%>
<form name="form1" method="post" action="adminlogin.jsp?action=yz">
<table width="350" border="1" align="center" cellpadding="0" cellspacing="1" bordercolor="#000000">
<tr bgcolor="#B1E1F3">
<td height="30" colspan="2">
<div align="center"><strong>管理员登陆</strong></div></td>
</tr>
<tr background="topBar_bg.gif">
<td width="128">
<div align="center"><font color="#FF0000">管理员账号:</font></div></td>
<td width="212">
<input type="text" name="username"> </td>
</tr>
<tr background="topBar_bg.gif">
<td>
<div align="center"><font color="#FF0000">密码:</font></div></td>
<td>
<input type="password" name="password1"></td>
</tr>
<tr background="topBar_bg.gif">
<td colspan="2">
<div align="center">
<input type="submit" name="cdf" value="确 定">
<input type="reset" name="Submit2" value="取 消">
</div></td>
</tr>
</table>
</form>
<%}else {
String sql;
String username=request.getParameter("username");
String password1=request.getParameter("password1");
String cdf=request.getParameter("cdf");
if((cdf!=null)&&(username!=null)){
sql="select user_name,password,islock from scott.admingly where user_name='"+username+"'";
ResultSet rs_lar=stmt.executeQuery(sql);
if(rs_lar.next()){
if(rs_lar.getString("password").equals(password1)){
session.putValue("username",username);
session.putValue("ispass","pass");
response.sendRedirect("adminbody.jsp");
}else{
out.print("<script>alert('对不起,密码不正确');window.location.href='adminlogin.jsp';</script>");
}
}else{
out.print("<script>alert('对不起,用户名不正确');window.location.href='adminlogin.jsp';</script>");
}
}
} %>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -