?? 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('帳號不能為空,請?zhí)顚?#039;);
return false;
}
if (formct.pwd.value=='' ){
alert('密碼不能為空,請?zhí)顚?#039;);
return false;
}
if (formct.verify_code.value=='' ){
alert('驗證碼不能為空,請?zhí)顚?#039;);
return false;
}
formct.Submit.disabled=true;
}
</script>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" bgcolor="#FFF5F0">圖書館系統(tǒng) </td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -