?? login.asp
字號:
<!--#include file="conn.asp"-->
<!--#include file="md5.asp"-->
<%
dim action
action = request.querystring("action")
call head()
if action="login" then
call login()
elseif action="logout" then
call logout()
else
if session("administrator")<>"" then
response.redirect "edit.asp"
end if
call logface()
end If
call foot()
sub login()
fname=request.form("name")
pass=MD5(request.form("pass"))
if fname<>"" then
sql="select * from admin where admin='"&fname&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if not rs.eof then
if ucase(pass)=ucase(rs("pws")) then
Response.Cookies("admin")="guoxue"
session("administrator")="administrator"
session("id")=rs("id")
response.redirect "edit.asp"
Else
Response.Write "<script>"
Response.Write "alert('密碼輸入錯誤,請重新輸入正確的密碼。');"
Response.Write "location.href='login.asp';"
Response.Write "</script>"
end if
Else
Response.Write "<script>"
Response.Write "alert('沒有此用戶存在,請輸入正確的用戶名。');"
Response.Write "location.href='login.asp';"
Response.Write "</script>"
end if
end if
end sub
sub head()
%>
<html>
<head>
<style type="text/css">
<!--
td { font-size: 12px; line-height: 17px }
body { font-size: 12px; line-height: 17px }
p { margin-top: 1; margin-bottom: 1 }
a:link { text-decoration: none; color: black }
a:visited { text-decoration: none; color: black }
a:active { text-decoration: none }
a:hover { text-decoration: underline; color: red }
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>管理員登錄</title>
<script language="javascript">
function checkform() {
if(document.form1.name.value=="")
{
alert("請輸入用戶名!");
document.form1.name.focus();
return false;
}
if(document.form1.pass.value=="")
{
alert("密碼不能為空,請輸入密碼!");
document.form1.pass.focus();
return false;
}
}
</script>
</head>
<%
end sub
sub logface()
%>
<body background="images/bg.gif">
<br><br>
<form action="?action=login" name='form1' method="post" onsubmit="return checkform()">
<table align='center' border="0" width="200" cellspacing="0" cellpadding='5'>
<tr><td colspan='2' align='center'><font size='3'> 系 統 管 理 </font><hr></td></tr>
<tr>
<td width="30%">
<p align="right">帳號:</td>
<td width="70%"><input type="text" name="name" size="15"></td>
</tr>
<tr>
<td>
<p align="right">密碼:</td>
<td><input type="password" name="pass" size="15"></td>
</tr>
<tr>
<td colspan="2">
<p align="center"><input type="submit" value="進 入" name="enter">
<input type="button" value="取 消" onclick="location.href='/'"></p>
</td>
</tr>
</table>
</form>
<%
end sub
sub foot()
%>
</body>
</html>
<%
end sub
sub logout()
session("administrator")=""
Response.Cookies("admin")=""
session("id")=""
Session.abandon
Response.Write "<script>"
Response.Write "alert('你已經安全退出了系統。');"
Response.Write "location.href='../index.asp';"
Response.Write "</script>"
end sub
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -