📄 login.asp
字号:
<!--#include file="inc/config.asp"-->
<!--#include file="inc/conndb.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>会员登录-<%=bbsname%></title>
<link href="images/hotlt.css" rel="stylesheet" type="text/css">
</head>
<%
if Request.Cookies("mctb_name")<> "" then
response.redirect "index.asp"
else
end if
if request("login")="登录" then
username=request("username")
pwd=request("pwd")
Code=trim(request.form("verify_code"))
if InStr(name,"or")<>0 or InStr(name,"'")<>0 or InStr(name,"`")<>0 or InStr(name,"=")<>0 or InStr(name,"-")<>0 or InStr(name,",")<>0 or InStr(name,"and")<>0 then
Response.Write "<script language=JavaScript>{alert('用户名含有非法字符!');history.back();}</script>"
Response.End
end if
if cstr(session("GetCodedl"))<>cstr(Code) then
Response.Write("<script language=javascript>alert('认证码错误!');history.back()</script>")
response.end
else
end if
Set rs = Server.CreateObject("ADODB.Recordset")
pwd=pwd
sql="select * from [user] where username='"&username&"' and password='"&pwd&"'"
rs.open sql,conn,3,2
if rs.eof then
response.write"<script>alert('用户名或密码错误!');history.back();</script>"
else
Response.Cookies("mctb_name")=username
Response.Cookies("mctb_name").Expires=Now() + 30
response.redirect "index.asp"
end if
end if
%>
<body>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="250" valign="top"><img src="images/bbslogo.jpg" ></td>
<td width="538"><form name="form1" method="get" action="index.asp" style="margin:5px;">
<input name="q" type="text" id="q" value="<%=keys%>" size="30">
<input type="submit" value=" 搜 索 ">
<input name="so" type="radio" value="title" checked>
搜索标题
<input type="radio" name="so" value="name">
搜索作者
</form></td>
<td width="160" align="center"><%
if name= "" then
response.write"<A href='login.asp'>登录</A> | <A href='reg.asp'>注册</A>"
elseif name<> "" then
response.write name&" | <A href='exit.asp'>退出</A>"
end if
%></td>
</tr>
</table>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0" class="tit">
<tr bgcolor="#E8F3FF">
<td height="25" bgcolor="#FFF5F0"> <a href="index.asp"><%=bbsname%></a> >> 会员登录</td>
<td width="20%" bgcolor="#FFF5F0"> </td>
</tr>
</table>
<form name="save" method="post" action="" onSubmit="return regcheck(this);">
<table width="99%" border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<td width="30%" height="30" align="right"><strong>帐 号:</strong></td>
<td>
<input name="username" type="text" id="username" size="20" maxlength="20">
</td>
</tr>
<tr>
<td height="30" align="right"><strong>密 码:</strong></td>
<td><input name="pwd" type="password" id="pwd" size="20" maxlength="20"></td>
</tr>
<tr>
<tr>
<td height="30" align="right"><strong>验证码:</strong></td>
<td><input name="verify_code" type="text" id="verify_code" size="4" maxlength="4">
<img src="inc/dlzcyz.asp"></td>
</tr>
<tr>
<td height="30" align="right"> </td>
<td><input type=submit name=login id=login value=登录>
<input name="submit3" type=button value='注册' onClick="window.location='reg.asp'">
</tr>
</table>
</form>
<script language="JavaScript1.2">
function regcheck(formct){
if (formct.username.value=='' ){
alert('帐号不能为空,请填写');
return false;
}
if (formct.pwd.value=='' ){
alert('密码不能为空,请填写');
return false;
}
if (formct.verify_code.value=='' ){
alert('验证码不能为空,请填写');
return false;
}
formct.Submit.disabled=true;
}
</script>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" bgcolor="#FFF5F0">图书馆系统 </td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -