gusucode.com > ASP+ACCESS学生论坛设计与实现(源代码+论文+开题报告) > ASP+ACCESS学生论坛设计与实现(源代码+论文+开题报告)\13学生论坛ASPAC\BBS\activepass.asp

    <!--#include file="conn.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="inc/md5.asp"-->
<%
dim username
dim password
dim repassword
dim answer
Mybbs.LoadTemplates("login")
Mybbs.Stats=template.Strings(21)
Mybbs.Nav()
Mybbs.Head_var 0,"",template.Strings(0),""
main
Mybbs.activeonline()
Mybbs.Footer()
Sub main()
	Dim Rs,SQL
	If request("username")="" or request("pass")="" or request("repass")="" or request("answer")="" then
		 showerr template.Strings(22)
	Else 
		username=Mybbs.checkStr(request("username"))
		password=Mybbs.checkStr(request("pass"))
		repassword=md5(Mybbs.checkStr(request("repass")),16)
		answer=md5(request("answer"),16)
		sql="select userpassword,userclass,UserGroupID from [Dv_user] where username='"&username&"' and userpassword='"&password&"' and useranswer='"&answer&"'"
		set rs=server.createobject("adodb.recordset")
		If Not IsObject(Conn) Then ConnectionDatabase
		rs.open sql,conn,1,3
		If rs.eof and rs.bof Then 
			showerr  template.Strings(23) 
			Exit  Sub 
		Else 
			If Rs("usergroupid")<4 Then
				showerr template.Strings(7) 
				Exit  Sub
			Else
				Rs("userpassword")=repassword
				Rs.Update
				Response.Write template.html(11)
				Rs.Close
				Set Rs=Nothing 
			End If 
		End If
	End If
End Sub

Sub showerr(errmsg)
	template.html(9)=Replace(template.html(9),"{$Errmsg}",errmsg)
	Response.Write template.html(9)
End Sub 
%>