📄 login.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="manage/inc/config.asp"-->
<!--#include file="manage/inc/conn.asp"-->
<%
if NOT isempty(request("LoginSubmit")) then
dim username,password
username=replace(trim(request("username")),"'","")
password=md5(replace(trim(request("password")),"'",""))
'if username="" or password="" then
' call MsgBox("对不起,登录失败,请检查您的登录名和密码","None","None")
'end if
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from [user] where username='"&username&"' and password='"&password&"' " ,conn,1,3
if not(rs.bof and rs.eof) then
if password=rs("password") then
response.Cookies(cookieName)("username")=trim(request("username"))
rs("lastvst")=now()
rs("loginnum")=rs("loginnum")+1
rs.Update
rs.Close
set rs=nothing
response.redirect "search.asp"
else
call MsgBox("对不起,您的用户名或密码有误!","Back","None")
end if
else
call MsgBox("对不起,您的用户名或密码有误!","Back","None")
end if
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>图书馆管理系统</title>
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style2 {color: #000000}
-->
</style>
</head>
<body>
<!--#include file="head.htm"-->
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="219" align="left" valign="top"> </td>
<td width="561" align="left" valign="top"> <br> <br> <table cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="18"><img src="images/w.gif"></td>
<td style="color:#415373">用户登陆</td>
</tr>
</table> <br> <form action="" method="post" name="loginfo" id="loginfo">
<table border="0" cellpadding="0" cellspacing="10" class="t1">
<tr>
<td width="170" height="22" align="right" ><span class="style2">用户名:</span></td>
<td width="235" height="22" >
<input name="username" type="text" class="inputstyle" id="username">
</td>
</tr>
<tr>
<td height="22" align="right" ><span class="style2">密码:</span></td>
<td height="22" >
<input name="password" type="password" class="inputstyle" id="password">
</td>
</tr>
<tr>
<td height="22" align="center" >
<script language="JavaScript">
<!--
function checkuu()
{
if(document.loginfo.username.value=="") {
document.loginfo.username.focus();
alert("用户名不能为空!");
return false;
}
if(document.loginfo.password.value=="") {
document.loginfo.password.focus();
alert("密码不能为空!");
return false;
}
}
//-->
</script>
</td>
<td height="22" >
<input name="LoginSubmit" onClick="return checkuu();" type="submit" id="LoginSubmit" value="登录">
</td>
</tr>
</table>
</form> <form name="admininfo" method="post" action="manage/login.asp" >
<table width="552" border="0" align="center" cellpadding="3" cellspacing="5">
<tr bgcolor="#FFFFFF">
<td colspan="2">
<table border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td width="18"><img src="images/w.gif"></td>
<td width="76" style="color:#415373">管理员登录</td>
</tr>
</table>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="167" bgcolor="#FFFFFF" align="right">管理员:</td>
<td width="358">
<input name="Name" type="text" id="admin2" class="inputstyle">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td bgcolor="#FFFFFF" width="167" align="right">密 码:</td>
<td width="358">
<input name="Pws" type="password" id="Pws" class="inputstyle">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="center" width="167"> </td>
<td width="358">
<input name="LoginSubmit" type="submit" id="LoginSubmit" value="登录">
</td>
</tr>
</table>
</form> </td>
</tr>
</table>
<!--#include file="foot.htm"-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -