日期:2014-05-16 浏览次数:20523 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page pageEncoding="GBK" %>
<html>
<%
request.setCharacterEncoding("gbk");
String username = request.getParameter("username");
String password = request.getParameter("password");
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Login Box HTML Code - www.PSDGraphics.com</title>
<link href="login-box.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.STYLE2 {font-size: 36px}
-->
</style>
<script type="text/javascript">
function check(){
var username = document.form1.username.value;
var password = document.form1.password.value;
if(username == null || username == ""){
alert("用户名不能为空!");
return false;
}else if(password == null || password == ""){
alert("密码不能为空!");
return false;
}else if(username == "admin" && password == "admin"){
alert("redirect");
response.sendRedirect("index.jsp");
return true;
}else{
alert("username=|" + username "|password=|" + password + "|";
return false;
}
}
</script>
</head>
<body>
<form name="form1" action="index.jsp" method="get" onsubmit="return check()" >
<div style="padding: 100px 0 0 250px;">
<div id="login-box">
<H2>用户登陆<br />
</H2>
<div id="login-box-name" style="margin-top:20px;">用户名:</div>
<div id="login-box-field" style="margin-top:20px;">
<input name="username" class="form-login" title="Username" value="" size="30" maxlength="2048" />
</div>
<div id="login-box-name">密码:</div>
<div id="login-box-field">
<input name="password" type="password" class="form-login" title="Password" value="" size="30" maxlength="2048" />
</div>
<br />
<span class="login-box-options">
<input type="checkbox" name="1" value="1">
Remember Me <a href="#" style="margin-left:30px;">Forgot password?</a></span> <br />
&n