Using a sort string field to implement a tree structure (routines-saving posts content)

Source: Internet
Author: User
Tags implement sort trim
Sort Program Name: savelyb.asp
Program function: Save the content of posts

<!--#include file= "Lybcon.inc"-->
<%
Posttype=request ("Posttype")
Pageno=request ("PageNo")
Keyid=request ("keyID")
If keyid= "" then keyid=0
Emailpost=request ("Emailpost")
Guestitle=trim (Request.Form ("Guestitle"))
Guestname=trim (Request.Form ("Guestname"))
Guestcomm=rtrim (Request.Form ("Guestcomm"))
Guestemail=request.form ("Guestemail")
Emailflag=request.form ("Emailflag")
If guestitle= "" or guestname= "" Then
Call Errmessage ("<center><br><br><font size=4 color=red> information incomplete, message title and name must be filled in </font> <br><br><a href= ' Javascript:history.back (); ' > Return refill </a> <a href= ' index.asp?pageno= ' &pageno& ' > Abort release </a></center> ')
Response.End
End If
Guestcomm=replace (Guestcomm, "", "")
Guestcomm=replace (GUESTCOMM,CHR), "<br>"
If emailflag= "on" Then
Temailflag=1
Else
Temailflag=0
End If

If session ("Guestitle") =guestitle then Response.Redirect "Index.asp"
Set Guestconn=server.createobject ("Adodb.connection")
Guestconn. Open Lybstr
Set cm = Server.CreateObject ("Adodb.command")
Set cm. ActiveConnection = Guestconn
Cm.commandtext = "Lybsave"
Cm.commandtype = 4
Set p = cm. Parameters
P.append cm. CreateParameter ("@keyid", 3,1,4)
P.append cm. CreateParameter ("@guestname", 202,1,20)
P.append cm. CreateParameter ("@guestitle", 202,1,100)
P.append cm. CreateParameter ("@guestcomm", 201,1,16000)
P.append cm. CreateParameter ("@guestemail", 202,1,50)
P.append cm. CreateParameter ("@emailflag", 17,1,1)
P.append cm. CreateParameter ("@fromip", 202,1,15)
P.append cm. CreateParameter ("@recimail", 202,2,50)

CM ("@keyid") =keyid
CM ("@guestname") =guestname
CM ("@guestitle") =guestitle
CM ("@guestcomm") =guestcomm
CM ("@guestemail") =ltrim (Guestemail)
CM ("@emailflag") =temailflag
CM ("@fromip") =request.servervariables ("REMOTE_ADDR")
Cm.execute


If trim (guestemail) = "" "Then Guestemail=" swuse@21cn.com "if the reply user did not fill in the email address, then use the moderator email address letter
If guestemail= "swuse@21cn.com abc" then guestemail= "swuse@21cn.com" "Handle Moderator email address
If cm ("@recimail") <> "" Then call Posttome
Call Errmessage ("<center><br><br><font color=56abff size=4> Thank you for your message!" <br><br></font><a href= ' index.asp?pageno= ' &pageno& ' > Reading message </a></center > ")
Session ("Guestitle") =guestitle
Guestconn.close
Set guestconn=nothing
Response.End

Sub Errmessage (message)%>
<style type= "Text/css" >
<!--
a {Text-decoration:none}
Body {line-height:18px;font-size:10.5pt;font-family: XXFarEastFont-Arial}
a:hover {color: #FF0000; Text-decoration:none}
-->
</style>
<body topmargin=16 background= ' topbg.gif ' >
<% =message%>
</body>
<% End Sub

Sub Posttome
Guestcomm=replace (Guestcomm, "", "")
Guestcomm=replace (Guestcomm, "<br>", "")
Set mymail = Server.CreateObject ("CDONTS. NewMail ")
Mymail.from = Guestemail
mymail.to = cm ("@recimail")
Mymail.subject = guestitle& "-" &guestname
Mymail.body =guestcomm & vbCrLf & vbCrLf & "Software use message thin http://swuse.yeah.net"
Mymail.send
Set mymail=nothing
End Sub
%>

The software uses the homepage http://swuse.yeah.net



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.