?? login.asp
字號:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!-- #INCLUDE FILE = "conn.asp" -->
<!-- #INCLUDE FILE = "MD5.asp" -->
<!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=gb2312" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {
color: #FFFFFF;
font-weight: bold;
}
-->
</style>
</head>
<%
dim act,username,password
act=request.QueryString("act")
if(act<>"" and act="login") then
username=request.Form("username")
password=md5(request.Form("password"),32)
Set rs=Server.CreateObject("ADODB.Recordset")
rs.open "select * from t_admin where adminname='"&username&"' and adminpass='"&password&"'",conn,3,1
if not rs.eof then
session("admin")="adminlogined"
response.Write("<script>parent.location.href='admin_index.asp';</script>")
else
response.Redirect("login.asp")
end if
rs.close
set rs=nothing
else
%>
<body>
<script language="javascript">
function check(obj){
with(obj){
if(username.value==""){
alert("用戶名不能為空!");
username.focus();
username.select();
return false;
}
if(password.value==""){
alert("密碼不能為空!");
password.focus();
password.select();
return false;
}
return true;
}
}
</script>
<form id="form1" name="form1" method="post" action="?act=login" onsubmit="return check(this)">
<table width="600" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7">
<tr>
<td height="22" colspan="2" bgcolor="#006699"><div align="center" class="style1">用戶登錄</div></td>
</tr>
<tr>
<td width="300" height="30" bgcolor="#FFFFFF"><div align="right">用戶名:</div></td>
<td width="300" bgcolor="#FFFFFF"><input name="username" type="text" id="username" size="20" /></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><div align="right">密碼:</div></td>
<td height="30" bgcolor="#FFFFFF"><input name="password" type="password" id="password" size="20" /></td>
</tr>
<tr>
<td colspan="2" bgcolor="#FFFFFF"><div align="center">
<input type="submit" name="Submit" value="登錄" />
<input type="reset" name="Submit2" value="取消" />
</div></td>
</tr>
</table>
</form>
<%
end if
%>
</body>
</html>
<%
call connclose()
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -