login.jsp
来自「--- --^_^-------------- 广师公寓中心 1.请装上」· JSP 代码 · 共 111 行
JSP
111 行
<%@ page contentType="text/html; charset=gb2312" %>
<%@ page language="java" import="java.sql.*" %>
<%
int counter=0;
Cookie cookies[]=request.getCookies();
if(cookies!=null){
for(int i=0;i<cookies.length;i++){
if(cookies[i].getName().equals("counter"))
counter=Integer.parseInt(cookies[i].getValue());
}
}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>管理员登录</title>
<!--验证用户名跟密码-->
<script language="JavaScript">
<!--
function validateLogin(){
var strusername=document.form2.textfield2.value;
var strpassword=document.form2.textfield3.value;
if(strusername==""){
alert("请输入用户名!");
return false;
}
if(strpassword==""){
alert("请输入密码!");
return false;
}
}
-->
</script>
</head>
<body background="images/background.gif">
<div align="center">
<table width="635" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="681" height="110"> </td>
</tr>
<tr>
<td height="241" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="681" height="49" valign="top"><img src="images/gongyu_033.gif" width="681" height="57"></td>
</tr>
<tr>
<td height="113" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/glry_11.gif">
<!--DWLayoutTable-->
<tr>
<td height="18" colspan="3" valign="top"><div align="left"><font color="#FF0000" size="2">
<jsp:include page="time.htm"/>
<%
if(counter==0){
//if(session.getAttribute("counter1") == null){
out.print("欢迎首次光临!");
}
else{
out.print("今天您已经光临了"+counter+"次!");
//out.print("您已经光临了"+session.getAttribute("counter1")+"次!");
}
%>
</font></div></td>
</tr>
<tr>
<td height="24" colspan="3" valign="top"><div align="center"><font size="5" face="隶书"> 管理员登录:</font></div></td>
</tr>
<tr>
<td width="152" height="93"> </td>
<td width="355" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="355" height="93" valign="top"><form name="form2" method="post" action="checklogin.jsp" onSubmit="javaScript:return validateLogin();">
<br>
用户名:
<input type="text" name="textfield2">
<br>
<br>
密 码:
<input type="password" name="textfield3">
<p align="center">
<input type="reset" name="Submit" value="重置">
<input type="submit" name="Submit2" value="提交">
<input type="button" name="Submit3" value="返回" onClick="javascript:history.back();">
</p>
</form></td>
</tr>
</table></td>
<td width="174"> </td>
</tr>
</table></td>
</tr>
<tr>
<td height="46" valign="top"><img src="images/glry_12.gif" width="680" height="48"></td>
</tr>
</table></td>
</tr>
<tr>
<td height="187"> </td>
</tr>
</table>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?