The application of ASP technology in the forum. (eight) (building the full program of the forum, vomiting blood recommended!!!! )

Source: Internet
Author: User
Use session to maintain authentication of the owner, which must require that the client browser's cookie be opened. Because the session is implemented through cookies. Here, the Kanban ID is assigned to the session variable Beenthere, indicating that the owner has passed the authentication. In each subsequent version of the page, check to see if the Beenthere and the corresponding version ID match.
Url= "boardmanager.asp?boardid=" & Boardid
Response.Redirect URL
When the beginning of the ASP is always for Response.Redirect This method is confused, repeatedly with uncomfortable, now I come to tell you some skills. Before you can use it, you must use the Response.buffer=true to make the ASP page work with buffers. At this point, before the ASP is interpreted as HTML code, it is placed in a buffer instead of being sent directly to the client browser. Another must know is that no actual HTML code can be sent to the client browser before using Response.Redirect, otherwise there will be an error. Of course, there are workarounds, if the HTML code has been interpreted before Response.Redirect, you can use the Response.Clear method to clear the buffer, and then you can use it for redirection.
End If
%>
   
The following page is the target of redirection after authentication passed: boardmanager.asp. It will list all the articles that have not been processed.
<%
Boardid=request ("Boardid")
If session ("Beenthere") < >boardid then Response.Redirect "Forums.asp"
This is the test of the identity of the site, because the previous cookie in the owner's browser has been marked, now we can through the seesion to identify the identity of the owner. If the logo does not match, it will return to the first landing page via Response.Redirect. If the cookie in the owner's browser is not open, the value of Seesion ("Beenthere") will be empty and the page cannot be entered.
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
Sql= "SELECT name from Kanban list where id=" & Boardid
Set Rs=conn.execute (SQL)
Boardname=rs ("name")
cmd.commandtext= "List of unpublished articles"
ReDim param (0) ' statement
Param (0) = CLng (boardid) ' CInt cannot be ignored
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.