⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 login.asp

📁 学生档案管理系统。。 调试测试可以用。
💻 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">密&nbsp; 码:</td>
									<td><input type="password" name="xs_pass" maxlength="16"></td>
								</tr>
								<tr>
								    <td>角&nbsp; 色:</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">&nbsp;&nbsp;<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 + -