当前位置: 首页 > 图文教程 > 网络编程 > ASP > 用排序串字段实现树状结构(例程:保存贴子内容)

ASP
asp实现取得数组中的最大值的代码
asp 将日期格式化为需要的格式
asp 下产生任意位数随机密码的代码
asp下返回以千分位显示数字格式化的数值
asp重定向页面的方法总结
asp下去除数组中重复的项的方法
asp下实现 重新排序数字数组的代码
asp 验证输入网址是否有效并可以访问 与正则验证输入网址
asp验证Ip格式的函数
asp实现生成由数字,大写字母,小写字母指定位数的随机数
asp 格式化sql中的like字符串
asp 实现显示所有的服务器变量值的函数
asp 取得用户真实IP,对代理地址仍然有效的函数
asp 通用数据库连接过程函数
asp 字符串截取函数
asp下实现格式化文件大小以MB显示的函数
asp 下用正则表达式检测邮箱格式的函数
asp 实现检测字符串是否为纯字母和数字组合的函数
asp代码实现检测组件是否安装的函数
asp通过JMAIL实现通用发送函数

ASP 中的 用排序串字段实现树状结构(例程:保存贴子内容)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 200 ::
收藏到网摘: n/a

       程序名称:savelyb.asp
  程序功能:保存贴子内容
  
  <!-- #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>资料不完整,留言标题和姓名必须填写
  </font><br><br><a href='javascript:history.back();'>返回重填</a> <a href='index.asp?pageno="&pageno&"'>
  放弃发表</a></center>")
   response.end
  end if
  guestcomm=replace(guestcomm," "," ")
  guestcomm=replace(guestcomm,chr(13),"<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="[email protected]" '如果回复的用户没有填写Email地址,则使用版主Email地址
  发信
  if guestemail="[email protected] abc" then guestemail="[email protected]" '处理版主邮件地址
  if cm("@recimail")<>"" then call posttome
  call errmessage("<center><br><br><font color=56abff size=4>谢谢你的留言!<br><br></font><a href='index.asp?
  pageno="&pageno&"'>阅读留言</a></center>")
  session("guestitle")=guestitle
  guestconn.close
  set guestconn=nothing
  response.end
  
  sub errmessage(message) %>
  <html>
  <head><title>软件使用留言薄回复</title>
  <style TYPE="text/css">
  <!--
  a { text-decoration: none}
  body {line-height:18px;font-size:10.5pt;font-family:宋体}
  a:hover {color:#FF0000;text-decoration:none}
  -->
  </style>
  </head>
  <body topmargin=16 background='topbg.gif'>
  <% =message %>
  </body>
  </html>
  <% end sub
  
  sub posttome
   guestcomm=replace(guestcomm," "," ")
 &n