📄 reg.asp
字号:
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/config.asp"-->
<%
if NOT isempty(request("regsubmit")) then
dim login
session("login")=0
session("id")=replace(trim(request("sno")),"'","")
session("psw")=replace(trim(request("psw")),"'","")
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from [user] where id='"&session("id")&"' and psw='"&session("psw")&"' " ,conn,1,3
if not(rs.bof and rs.eof) then
if session("psw")=rs("psw") then
'rs.Update
rs.Close
set rs=nothing
response.redirect "index.asp"
else
call MsgBox("对不起,您的用户名或密码有误!","Back","None")
end if
else
call MsgBox("对不起,您的用户名或密码有误!","Back","None")
end if
end if
%>
<html>
<head>
<style type="text/css">
<!--
body {
font-size:9pt;
background-image: url(images/Fiesta%20Bkgrd.jpg);
}
td {font-size:9pt}
table{font-size:9pt}
.style4 {
color: #E8A477;
font-weight: bold;
}
.style5 {
color: #E8A477;
font-size: 10pt;
}
.style6 {color: #E1874A}
.style7 {color: #E1874A; font-size: 10pt; }
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<!--#include file="head.asp"-->
<table width="985" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="49" colspan="5" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="985" height="49"><span class="style5"> </span></td>
</tr>
</table></td>
</tr>
<tr>
<td width="59" height="12"></td>
<td width="228"></td>
<td width="73"></td>
<td width="382"></td>
<td width="243"></td>
</tr>
<tr>
<td height="25"> </td>
<td> </td>
<td> </td>
<td rowspan="2" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="381" height="185">
<table align="center">
<!--DWLayoutTable-->
<tr>
<td width="26" height="23"> </td>
<td colspan="2" valign="top"><span class="style4"><font size="+2">登录图书馆</font></span></td>
</tr>
<tr>
<Td height="17" colspan="2" valign="top"><hr></Td>
<Td width="115"> </Td>
</tr>
<tr>
<td height="5"></td>
<td width="204"></td>
<td></td>
</tr>
</table>
<form name="login" action="" id="login">
<table width="263">
<!--DWLayoutTable-->
<tr>
<td width="42" align="right">学号:</td>
<td width="169" align="right"><input name="sno" class="inputstyle" id="sno" type="text"></td>
</tr>
<tr><td height="8"></td>
<td> </td>
<td width="36"></td>
</tr>
<tr>
<td width="42" align="right">密码:</td>
<td width="169" align="right"><input name="psw" class="inputstyle" id="psw" type="password"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="确定" name="regsubmit" onClick="return checklogin()"> <input type="reset" value="清除" name="regreset"></td>
<td></td>
</tr>
</table>
</form>
</td>
</tr>
</table></td>
<td> </td>
</tr>
<tr>
<td height="160"> </td>
<td valign="middle"><p class="style5 style6">提示:
</p> <p class="style7"> 如果你是第一次登录本图书管理系统,你的用户名和密码都是你的学号,为了你的个人信息安全,请等录后修改密码,修改后请记住你的密码,如果万一忘记密码,请拿上学生证到学校教务处查询。</p></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td height="66"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<!--#include file="foot.htm"-->
<script language="JavaScript">
<!--
function checklogin()
{
if(checkspace(document.login.sno.value)) {
document.login.sno.focus();
alert("学号不能为空!");
return false;
}
if(checkspace(document.login.psw.value)) {
document.login.psw.focus();
alert("密码不能为空!");
return false;
}
function checkspace(checkstr) {
var str = '';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}
function regInput(obj, reg, inputStr)
{
var docSel = document.selection.createRange()
if (docSel.parentElement().tagName != "INPUT") return false
oSel = docSel.duplicate()
oSel.text = ""
var srcRange = obj.createTextRange()
oSel.setEndPoint("StartToStart", srcRange)
var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
return reg.test(str)
}
return true;
}
//-->
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -