📄 index.jsp
字号:
<%@ page contentType="text/html;charset=gb2312" import="java.awt.*,
java.awt.image.*,java.util.*,javax.imageio.*" %>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
<link rel="stylesheet" type="text/css" href="mystyle.css">
<html>
<head>
<title>
admin_login
</title>
<style type="text/css">
<!--
.f {
font-size: 16px;
color: #0033FF;
text-decoration: none;
background-color: #FFCCFF;
}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>
<body>
<script Language="JavaScript">
<!--
function isspacestring(mystring)
{ 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 firstisspace(mystring)
{ var istring=mystring;
var temp,i,strlen;
temp=false;
if (istring.substring(0,1)==" ")
{ temp=true; }
return temp;
}
function check_input(theForm)
{
if ((theForm.logname.value == "")|(firstisspace(theForm.logname.value)))
{
alert("请输入用户名.不能以空格开头");
theForm.logname.focus();
return (false);
}
if ((theForm.password.value == "")|(isspacestring(theForm.password.value)))
{
alert("请输入密码.");
theForm.password.focus();
return (false);
}
if ((theForm.rand.value == "")|(isspacestring(theForm.rand.value)))
{
alert("请输入验证吗.");
theForm.rand.focus();
return (false);
}
}
//-->
</script>
<% String str=response.encodeURL("index.jsp"); %>
<form name="form1" method="post" action="check.jsp" onSubmit="return check_input(this)">
<table width="1004" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/index_01.gif" width="172" height="263" alt="1" /></td>
<td><img src="images/index_02.gif" width="238" height="263" alt="2" /></td>
<td><img src="images/index_03.gif" width="594" height="263" alt="3" /></td>
</tr>
</table>
<table width="1004" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="246"> </td>
<td width="691"><table width="524" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/table_center_06.gif" width="524" height="51" alt="t2" /></td>
</tr>
<tr>
<td height="244" class="ta_bg"><table width="100%" border="0" cellspacing="3" cellpadding="4">
<tr>
<td width="22%" class="text1">用户名称:</td>
<td width="78%"><label>
<input name="logname" type="text" id="UserName4" maxlength="20" style="width:160px;border-style:solid;border-width:1;padding-left:4;padding-right:4;padding-top:1;padding-bottom:1" onMouseOver="this.style.background='#FDE8FE';" onMouseOut="this.style.background='#FFFFFF'" onFocus="this.select(); " size="20">
</label>
</td>
</tr>
<tr>
<td class="text1">用户密码:</td>
<td><label>
<input name="password" type="password" id="password" maxlength="20" style="width:160px;border-style:solid;border-width:1;padding-left:4;padding-right:4;padding-top:1;padding-bottom:1" onMouseOver="this.style.background='#FDE8FE';" onMouseOut="this.style.background='#FFFFFF'" onFocus="this.select(); " size="20">
</label></td>
</tr>
<tr>
<td class="text1">输入验证码:</td>
<td><label>
<input name="rand" size="5" maxlength="4" style="border-style:solid;border-width:1;padding-left:4;padding-right:4;padding-top:1;padding-bottom:1" onMouseOver="this.style.background='#FDE8FE';" onMouseOut="this.style.background='#FFFFFF'" onFocus="this.select(); ">
<%// 取随机产生的认证码(4位数字)
String sRand="";
Random random=new Random();
for (int i=0;i<4;i++){
String rand=String.valueOf(random.nextInt(10));
sRand+=rand;
}
session.setAttribute("rand",sRand);
%> <span class="f"><%=session.getAttribute("rand")%>
</label></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td align="right"><input name="Submit" type="submit" class="btn" value="提交" /></td>
<td><input name="Submit2" type="submit" class="btn" value="清除" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img src="images/table_center_09.gif" width="524" height="78" alt="t4" /></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<p align="center" class="c"><%if(session.getAttribute("login")!=null){%>
<script languaga="JavaScript">
alert("用户不存在,请重新输入!");
window.location = "index.jsp";
</script>
输入用用户名或密码错误<% session.setAttribute("login",null);}%></p>
<p align="center" class="c"><%if(session.getAttribute("rz")!=null){%> 输入用验证码错误<% session.setAttribute("rz",null);}%></p>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -