?? login.asp
字號:
<!--#include file=md5.asp-->
<!--#include file=conn.asp-->
<!--#include file=xwfun.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>學校檔案管理登錄</title>
<LINK rel="stylesheet" type="text/css" href="image/login.css">
</head>
<body>
<%
If request("action")="pass" Then
xs_user=uhtmlencode(Request("xs_user"))
xs_right=uhtmlencode(request("xs_right"))
xs_pass=request("xs_pass")
If xs_right="2" Then
Set Rs=conn.execute("select * from Admin where xs_user='"&xs_User&"' and xs_Pass='"&xs_Pass&"'")
If not Rs.eof Then
session("xs_right")=rs("xs_right")
Session("Admin")=Rs("xs_user")
Session("xs_pass")=rs("xs_pass")
Response.Redirect "xs_main.asp"
Response.End
Else
Response.Write "<script>alert('非法操作:用戶名或密碼錯誤!\n或角色有誤!!');this.location.href='login.asp';</SCRIPT>"
Response.End
End If
End If
If xs_right="1" Then
Set rsgrade=conn.execute("select * from grade where 班級ID='"&xs_user&"' and 班主任密碼='"&xs_Pass&"'")
If not rsgrade.eof Then
session("班主任密碼")=rsgrade("班主任密碼")
Session("grade")=rsgrade("班主任")
Response.Redirect "xs_main.asp"
Response.End
Else
Response.Write "<script>alert('非法操作:用戶名或密碼錯誤!\n或角色有誤!!');this.location.href='login.asp';</SCRIPT>"
Response.End
End If
End If
If xs_right="0" Then
Set rsst=conn.execute("select * from student where 學生ID='"&xs_user&"' and 密碼='"&xs_Pass&"'")
If not rsst.eof Then
Session("密碼")=rsst("密碼")
Session("student")=rsst("學生ID")
Response.Redirect "xs_main.asp"
Response.End
Else
Response.Write "<script>alert('非法操作:用戶名或密碼錯誤!\n或角色有誤!!');this.location.href='login.asp';</SCRIPT>"
Response.End
End If
End If
If Request.Form("code") <> "" Then
If ValidCode("CSName",Request.Form("codeKey"),Request.Form("code")) Then
Else
response.write"<script>alert('輸入的驗證碼錯誤!');this.location.href='login.asp';</script>"
End If
End If
Rem 判斷驗證碼輸入是否正確的函數
Function ValidCode(pSN,k,c)
Dim s,i
s = Session(pSN)
k = ";"&k&":"
ValidCode = False
i = InStr(s,k)
If i > 0 Then
If InStr(s,k&c&";") > 0 Then ValidCode = True
Session(pSN) = Left(s,i) & Right(s,Len(s)-InStr(i+1,s,";"))
End If
End Function
End If
Dim codeKey
codeKey = Int(Timer()*10)
%>
<div class="div1">
<p id="a1">學生檔案管理系統</p>
<div id="aa">
<table border="0" cellpadding="2" cellspacing="2" style="border-collapse: collapse" width="260" align="center">
<tr>
<td style="padding-left:10px;" align="center">· 管理登陸 ·</td>
</tr>
<tr>
<td>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<form name="form1" method="post" action="?action=pass" onsubmit="return fmchk(this)">
<tr>
<td height="30">用戶名:</td>
<td><input type="text" name="xs_user" maxlength="16" width="120" ></td>
</tr>
<tr>
<td height="30">密 碼:</td>
<td><input type="password" name="xs_pass" maxlength="16"></td>
</tr>
<tr>
<td>角 色:</td>
<td>
<select name="xs_right">
<option value="0" selected>學生</option>
<option value="1">老師</option>
<option value="2">管理員</option>
</select>
</td>
</tr>
<tr><td><input type="hidden" name="codeKey" value="<%=codeKey%>">驗證碼:</td>
<td><input type="text" name="code" value="" size="4" maxlength="4" autocomplete="off"><img src="DvCode.asp?k=<%=codeKey%>&" onclick="this.src+=parseInt(Math.random()*10)" alt="點擊可刷新">刷新</td></tr>
<tr>
<td height="40" colspan="2" align="center"><input type="submit" value=" 登錄 " class="bmit"> <input type="reset" value=" 重置 " class="bmit"></td>
</tr>
<tr>
<td colspan="2"><a href="xw_ze.asp">注冊用戶</a></td>
</tr>
</form>
</table>
</td>
</tr>
</table>
</div>
</div>
</BODY>
</HTML>
<script language="javascript">
fm1.code.focus();
function fmchk(fm){
if (fm.code.value==''){
alert('請輸入驗證碼!');
fm.code.focus();
return false;
}
return true;
}
</script>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -