bbs的登陸login.asp代碼如下:
<!--#include file="conn.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="inc/char_login.asp"-->
<!--#include file="md5.asp"-->
<%
'=========================================================
' File: login.asp
' Version:5.0
' Date: 2002-9-10
' Script Written by satan
'=========================================================
' Copyright (C) 2001,2002 AspSky.Net. All rights reserved.
' Web: http://www.aspsky.net,http://www.dvbbs.net
' Email: info@aspsky.net,eway@aspsky.net
'=========================================================
stats="填寫登陸資訊"
dim url,comeurl
call nav()
call head_var(2,0,"","")
if request("action")="chk" then
call chklogin()
if founderr then call dvbbs_error()
else
url=Request.ServerVariables("HTTP_REFERER")
%>
<form action="login.asp?action=chk" method=post>
<table cellpadding=3 cellspacing=1 align=center class=tableborder1>
<tr>
<th valign=middle colspan=2 align=center height=25>請輸入您的使用者名稱、密碼登陸</td></tr>
<tr>
<td valign=middle class=tablebody1>請輸入您的使用者名稱</td>
<td valign=middle class=tablebody1><INPUT name=username type=text> <a href=../reg.asp>沒有註冊?</a></td></tr>
<tr>
<td valign=middle class=tablebody1>請輸入您的密碼</font></td>
<td valign=middle class=tablebody1><INPUT name=password type=password> <a href=lostpass.asp>忘記密碼?</a></td></tr>
<tr>
<td class=tablebody1 valign=top width=30% ><b>Cookie 選項</b><BR> 請選擇你的 Cookie 儲存時間,下次訪問可以方便輸入。</td>
<td valign=middle class=tablebody1> <input type=radio name=CookieDate value=0 checked>不儲存,關閉瀏覽器就失效<br>
<input type=radio name=CookieDate value=1>儲存一天<br>
<input type=radio name=CookieDate value=2>儲存一月<br>
<input type=radio name=CookieDate value=3>儲存一年<br> </td></tr>
<tr>
<td valign=top width=30% class=tablebody1><b>隱藏登陸</b><BR> 您可以選擇隱藏登陸,論壇會員將在使用者列表看不到您的資訊。</td>
<td valign=middle class=tablebody1> <input type=radio name=userhidden value=2 checked>正常登陸<br>
<input type=radio name=userhidden value=1>隱藏登陸<br>
</td></tr>
<input type=hidden name=comeurl value=<%=url%>>
<tr>
<td class=tablebody2 valign=middle colspan=2 align=center><input type=submit name=submit value="登 陸"></td></tr></table>
</form>
<%
end if
call footer()
sub chklogin()
dim UserIP
dim username
dim userclass
dim password
dim article
dim cookies_path_s,cookies_path_d,cookies_path,usercookies
UserIP=Request.ServerVariables("REMOTE_ADDR")
if request("username")="" then
errmsg=errmsg+"<br>"+"<li>請輸入您的使用者名稱。"
founderr=true
else
username=trim(checkStr(request("username")))
end if
if request("password")="" then
errmsg=errmsg+"<br>"+"<li>請輸入您的密碼。"
founderr=true
else
password=md5(trim(checkStr(request("password"))))
end if
'判斷更新cookies目錄
cookies_path_s=split(Request.ServerVariables("PATH_INFO"),"/")
cookies_path_d=ubound(cookies_path_s)
cookies_path="/"
for i=1 to cookies_path_d-1
if not (cookies_path_s(i)="upload" or cookies_path_s(i)="admin") then cookies_path=cookies_path&cookies_path_s(i)&"/"
next
if cookiepath<>cookies_path then
cookiepath=cookies_path
conn.execute("update config set cookiepath='"&cookiepath&"'")
end if
if founderr then exit sub
usercookies=request("CookieDate")
if chkuserlogin(username,password,usercookies,1)=false then
errmsg=errmsg+"<br>"+"<li>您的使用者名稱並不存在,或者您的密碼錯誤,或者您的帳號已被管理員鎖定。"
founderr=true
exit sub
end if
dim comeurlname
if instr(lcase(request("comeurl")),"reg.asp")>0 or instr(lcase(request("comeurl")),"login.asp")>0 or trim(request("comeurl"))="" then
comeurlname=""
comeurl="index.asp"
else
comeurl=request("comeurl")
comeurlname="<li><a href="&request("comeurl")&">"&request("comeurl")&"</a></li>"
end if
%>
<meta HTTP-EQUIV=REFRESH CONTENT='2; URL=<%=comeurl%>'>
<table cellpadding=3 cellspacing=1 align=center class=tableborder1 >
<tr>
<th height=25>登陸成功:<%=Forum_info(0)%>歡迎您的到來</th>
</tr>
<tr><td class=tablebody1><br>
<ul><%=comeurlname%><li><a href=index.asp>返回首頁</a></li></ul>
</td></tr>
</table>
<%
end sub
%>