The source code of a BBS (v)

Source: Internet
Author: User
Tags empty modify
Source code ' ==================================================================================================
Case "Modify"
'==================================================================================================
' Modify the article

Which = Request ("Which")
Whichid = GetID (Which)

If Left (Which, 1) = "E" Then table = "BBS" Else table = "Bbsreply"

Wrongmsg = ""

If Request ("Modify") = "Yes" Then

Userid = Request ("Userid")
Password = Request ("Password")
title = Trim (Request ("Title"))
Content = RTrim (Request ("Content"))

If title = "" Then wrongmsg = wrongmsg + "<DD><LI> title cannot be empty. </LI> "
If content = "Then wrongmsg = wrongmsg +" <DD><LI> contents cannot be empty. </LI> "

If wrongmsg = "" Then
Recbbs.open "SELECT [author] from" & Table & "WHERE [serial number]=" & Whichid, Con, 1
If Recbbs.fields ("author") = Userid Then
SQL = "Select COUNT (*) from Bbsmember WHERE [Account]= '" & Sqlstr (Userid) & "' and [Password]= '" & Sqlstr (Password) & "'"
Recmember.open SQL, Con, 1
If recmember.fields (0) > 0 Then
SQL = "UPDATE" & Table & "SET [topic]= '" & Sqlstr (title) & "', [Content]= '" & Sqlstr (contents) & "' WHERE [Serial number]= ' & Whichid
Con.execute (SQL)
Else
wrongmsg = "<DD><LI> password is incorrect. </LI> "
End If
Recmember.close
Else
wrongmsg = "<DD><LI> username is incorrect. </LI> "
End If
Recbbs.close
End If

End If

Title = ""
Content = ""

SQL = "SELECT [topic],[content] from" & Table & "WHERE [Ordinal]=" & Whichid
Recbbs.open SQL, Con, 1

If not recbbs.eof Then
title = Recbbs.fields ("topic")
Content = Recbbs.fields ("content")
End If
Recbbs.close
%>
<table align=center border=0 cellpadding=1 cellspacing=0 width=650>
<TR>
&LT;TD class= "Menu" >
<a href= "/" > Fly Linzhuang </a>-><a href= "<%= asp_file_name%>" > Experience Exchange </a>-><a href= "<% = Asp_file_name%>? job=content&which=<%= session ("Bbs_which")%> "><%= session (" Bbs_whichtitle ")%></a>
<% If wrongmsg <> "" Then%>
<BR><BR> modification failed! <BR><BR>
<%= wrongmsg%><br>
<% Else%>
<BR><BR> Modification Success! <BR><BR>
<% End If%>
<form action= "<%= asp_file_name%>" method=post>
<input Type=hidden name=job value=modify>
<input Type=hidden name=modify value=yes>
<input type=hidden Name=which value= "<%= Which%>" >
Account: <input type=text id=userid name=userid size=30 maxlength=80><br>
Password: <input type=password id=password name=password size=30 maxlength=80><br><br>
Title: <input type=text id=title name=title value= "<%= Title%>" >
<textarea id=content name=content cols=80 rows=16><%= Content%></textarea><br>
<input type=submit value= "Confirm modification" >
</FORM>
</TD>
</TR>
</TABLE>

<%
'==================================================================================================
Case "Apply"
'==================================================================================================
' Application account
%>

<table align=center border=0 cellpadding=7 cellspacing=0 width=650>
<TR>
&LT;TD class=menu>
<form action= "<%= asp_file_name%>" method=post>
<input Type=hidden name=job value=adduser>
<P> Fly Linzhuang-> Experience Exchange-> registered account </P>
<P>
The necessary information:<br>
<font color= #ff0000 > account </font>:
<input Id=userid Name=userid size=40 maxlength=80><br>
This is your personal identification, you can use Chinese or English. <BR>
<font color= #ff0000 > Password </font>:
<input id=password Name=password Type=password maxlength=80 size=25><br>
To protect the legitimate rights and interests of your account, please choose your password carefully! <BR>
<font color= #ff0000 > Repeat password </font>:
<input id=confirm name=confirm Type=password maxlength=80 size=25><br>
Confirm your password. <BR>
<font color= #ff0000 > E-mail </font>:
<input Id=em



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.