📄 login.asp
字号:
<link href="style.css" type="text/css" rel="stylesheet">
<!--#include file="conn.asp"-->
<% if request("login")<>"" then
if request("usertype")<>"" then '用户类型不空,核实数据真实
If Request("usertype")="user" Then
sql = "select * from u where name='"&request("name")&"' and pwd='"&request("pwd")&"'"
Else
sql = "SELECT * FROM admin WHERE name='"&Request("name")&"' and pwd='"&Request("pwd")&"'"
End If
Set rs=db.execute(sql)
If not rs.EOF Or Not rs.BOF Then '输入数据存在
If Request("usertype")="user" Then
Session("usertype")="user"
Session("userid")=rs("id")
Session("name")=rs("name")
Response.Redirect("index.asp")
Else
Session("usertype")="admin"
Session("adminid")=rs("id")
Session("name")=rs("name")
Response.Redirect("index.asp")
End If
Else
response.Write"<script>alert('输入错误!');window.location.href='login.asp'</script>"
rs.close
End if
end if
end if
%>
<STYLE>
<!--
a:link {color:blue;font-size:20px;}
a:visited {color:red;font-size:24px;text-decoration:none; }
a:active {color:green;font-size:20px;}
a:hover {color:yellow;font-size:150%;text-decoration:none;}
.STYLE1 {
font-size: 14pt;
font-weight: bold;
}
.STYLE2 {
font-size: xx-large;
font-weight: bold;
font-family: "华文行楷";
color: #C0E9C7;
}
-->
</style>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>lib</title>
</head>
<body>
<form name="form" method="POST" action="" >
<div align="center" class="STYLE2">
<p>图书管理系统 </p>
<p align="left"><marquee behavior="alternate"><img src="images/wel.gif" width="128" height="138"></marquee></p>
</div>
<table width="333" height="133" border="0" align="center" cellpadding="4" cellspacing="1" >
<tr class="header" align="center">
<td height="26" colspan="2"><span class="STYLE1">用户登陆</span> </td>
</tr>
<tr >
<td width="30%" nowrap > 用户名:</td>
<td>
<input name="name" type="text">
</td>
</tr>
<tr >
<td nowrap >密码:</td>
<td>
<input name="pwd" type="password" id="Text1" >
</td>
</tr>
<tr >
<td nowrap >用户类别:</td>
<td><select name="usertype" id="select" >
<option value="user" >普通用户</option>
<option value="admin">管理员</option>
</select></td>
</tr>
<tr >
<td nowrap><a href="reg.asp" target="_blank">注册</a> </td>
<td>
<input type="submit" value="登陆">
<input type="reset" value="重写"></td><input type="hidden" name="login" value="form">
</tr>
</table></form></body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -