📄 login.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" %>
<%@ page session="true" %>
<jsp:useBean id="alogin" scope="page" class="com.bookshop.dao.Login" />
<%
String mesg = "";
if( request.getParameter("username")!=null && !request.getParameter("username").equals("")){
String username =request.getParameter("username");
String passwd = request.getParameter("passwd");
username = new String(username.getBytes("ISO8859-1"));
passwd = new String(passwd.getBytes("ISO8859-1"));
alogin.setUsername(username);
alogin.setPasswd(passwd);
alogin.setIsadmin(true);
if (alogin.excute()){
session.setAttribute("admin","admin"); %>
<jsp:forward page="main.jsp" />
<%
}else {
mesg = "登录出错!" ;
}
}
%>
<html>
<head>
<title>倾城书屋管理系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>a{TEXT-DECORATION:none}a:hover{TEXT-DECORATION:underline}</style>
<script language="JavaScript">
setInterval("a.innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());",1000);
</script>
<script language="javascript">
function checkform() {
if (document.form1.username.value=="" || document.form1.passwd.value==""){
alert("用户名或密码为空!");
return false;
}
return true;
}
</script>
<style type="text/css">
<!--
.style14 {color: #3366FF}
.style16 {font-size: 18px; color: #3366FF;}
.style17 {font-size: 14px}
.style18 {color: #3366FF; font-size: 14px; }
-->
</style>
</head>
<body text="#000000">
<div align="center">
<table width="750" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><img src="../images/title.jpg" width="744" height="100"></td>
</tr>
</table>
<table width="750" border="0" cellspacing="1" cellpadding="1" >
<tr>
<td width="100" height="30" align="center" background="../images/qntj.jpg" class="style14"><a href="../index.jsp" class="style18">首页</a></td>
<td width="100" align="center" background="../images/qntj.jpg" class="style14"><a href="../booklist.jsp" class="style18">在线购物</a></td>
<td width="100" align="center" background="../images/qntj.jpg" class="style14"><a href="../shoperlist.jsp" class="style18">我的购物车</a></td>
<td width="100" align="center" background="../images/qntj.jpg" class="style14"><a href="../login.jsp" class="style18">用户登录</a></td>
<td width="100" align="center" background="../images/qntj.jpg" class="style14"><a href="../manage/login.jsp" class="style14 style17">网站管理</a></td>
<td width="250" align="center" background="../images/qntj.jpg"><div id="a"><span class="style7"></span></div></td>
</tr>
</table>
<p> </p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center">
<form name="form1" method="post" action="login.jsp">
<table width="304" border="1" cellspacing="0" cellpadding="0" bordercolor="#66CCFF" style="font-size:9pt">
<tr align="center">
<td colspan="2">
<font color="#FF0000" class="style16">51网上书店管理系统</font>
<% if (!mesg.equals("")){
out.println(mesg);}%>
</td>
</tr>
<tr>
<td width="106" height="35" align="right" class="style14">管理员</td>
<td width="192">
<input type="text" name="username" size="20" maxlength="20" height="20">
</td>
</tr>
<tr>
<td width="106" height="38" align="right" class="style14">管理员密码</td>
<td>
<input type="password" name="passwd" size="20" maxlength="20" height="20">
</td>
</tr>
<tr align="center">
<td height="40" colspan="2">
<input type="submit" name="Submit" value="登录" onclick="javascript:return(checkform());">
<input type="reset" name="Submit2" value="取消">
</td>
</tr>
<tr align="center">
<td colspan="2"><A HREF="../index.jsp" class="style16">返回首页</A></td>
</tr>
</table>
<p> </p>
<p> </p>
</form>
</table>
<hr width="750" color="#00CCFe"/>
<table width="750" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" >
<div align="center" class="style11">06计算机科学与技术3班
<br>
CopyRight@2009
<br>
E-mail:
<a href="mailto:dengxianghai2005@163.com">Jinlf112@163.com</a>
</div></td>
</tr>
</table>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -