<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户登录</title>
<style type="text/css">
*{ margin:0px; padding:0px;font-size:13px;}
.main{ margin:0px auto;}
table{margin:100px auto; line-height:30px; }
.txt{ width:150px;}
label{cursor:pointer;}
</style>
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
$(function(){
$("[width='77']").click(function(){
$.ajax({
url:"home.asp",
type:"post",
data:{username:$("input:text").val(),password:$("input:password").val()},
dataType:"text",
beforeSend:function(){
$("div[style^='color']").append("beforeSend<br/>");
},
success:function(data){
$("div[style^='color']").append(data);
if(data=="ok")
window.location.href="login.html";
},
error:function(error){
$("div[style^='color']").append(error + "error<br/>");
}
});
});
});
</script>
</head>
<body>
<div class="main">
<form id="form1ogin" name="form1" method="post" action="">
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" align="center" style="font-size:20px; text-align:center">用户登录</td>
</tr>
<tr>
<td><div align="right">用户名:</div></td>
<td><div align="left">
<input type="text" name="username" class="txt" />
</div></td>
</tr>
<tr>
<td><div align="right">密码:</div></td>
<td><div align="left">
<input type="password" name="password" class="txt" />
</div></td>
</tr>
<tr>
<td> </td>
<td><label><img src="images/login/login_qq.jpg" width="77" height="23" /></label>
</td>
</tr>
<tr>
<td> </td>
<td align="left" style="font-size:20px;"><div style="color:red;"></div></td>
</tr>
</table>
</form>
</div>
</body>
</html>
home.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
response.ContentType = "text/html"
response.expires = 0
response.expiresabsolute = Now() - 1
response.addHeader "pragma", "no-cache"
response.addHeader "cache-control", "private"
response.CacheControl="no-cache"
if request.form("username")="admin" and request.form("password")="admin" then
response.write("ok")
else
response.write(request.form("username") & request.form("password") & "error_user")
end if
response.end()
%>
浙公网安备 33010602011771号