This may be the heart of our forum, but it is nothing special to realize. Or those old things: Form processing, database query, in the use of ASP to integrate them organically.
When entering the article review mode (referred to the Board processing), the most important content, should be the identity of the owner to verify. Here's a look at the owner landing page:
<%
Boardid=request ("Boardid")
The Boardid is passed through the link entering this page, is the ID of Kanban that is to be handled by the board. It is through it to know that the board is dealing with the board.
Set conn = Server.CreateObject ("ADODB. Connection ")
Conn. Open "Driver={microsoft Access driver (*.mdb)};d bq=" & Server.MapPath ("Bbssystem.mdb")
Set cmd = Server.CreateObject ("Adodb.command")
Set cmd. ActiveConnection = conn
Cmd.commandtext = "board Master password Query"
ReDim param (0) ' statement
Param (0) = CLng (boardid) ' CLng cannot be ignored
Set rs = cmd. Execute (, param)
Boardmanager=rs ("board Master")
Set cmd=nothing
%>
< html>
< head>
< title>untitled document</title>
< meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
< body bgcolor= "#FFFFFF" >
< p> only board main <%=boardmanager%> can enter this place </p>
< p> Please enter the authentication password and, in order to remain authenticated, open the browser's cookies. </p>
< form method= "POST" action= "managerloginrest.asp" >
< input type= "password" name= "password" >
< input type= "hidden" name= "Boardid" value=<%=boardid%>>
< input type= "submit" name= "Submit" value= "OK" >
</form>
This page is only used for landing, it gets the password entered by the moderator, and can not be validated, but the validation of the work on the next page. In fact, the work of password input and validation can be done in one page, but the structure of the code is a bit cumbersome.
</body>
<%
Set rs=nothing
Conn.close
Set conn=nothing
%>
Now get the owner ID and enter the password, the following is the validation of the work managerloginrest.asp, it accepts the above file in the form of the content, and related processing:
<%
Response.buffer=true
Set the buffer to allow use. In general, this should be added to the header of each ASP page, which can improve the performance of ASP pages. After opening the buffer, there are some special usages in the ASP, which are mentioned later.
Boardid=request ("Boardid")
Password=request ("password")
Set conn = Server.CreateObject ("ADODB. Connection ")
Conn. Open "Driver={microsoft Access driver (*.mdb)};d bq=" & Server.MapPath ("Bbssystem.mdb")
Set cmd = Server.CreateObject ("Adodb.command")
Set cmd. ActiveConnection = conn
Cmd.commandtext = "board Master password Query"
ReDim param (0) ' statement
Param (0) = CLng (boardid) ' Cint cannot be ignored
Set rs = cmd. Execute (, param)
Boardmanager=rs ("board Master")
If password< > rs ("password") then%>
< html>
< head>
< title> authentication </title>
< meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
< body bgcolor= "#FFFFFF" >
Bad password
</body>
<%
Else
Session ("Beenthere") =boarded