postanswer.asp

来自「网易论坛 发表新贴子」· ASP 代码 · 共 40 行

ASP
40 行
字号
<!--#include file="opendb.asp"-->
<%
  
  ID=request.Form("id") 
  title=trim(request.Form("title"))
  content=trim(request.Form("content"))
  
  username=session("UserName")
  
  answertime=date()+time()
 
  StrSql = "INSERT INTO  Forum (Title,Content,LastAnswerTime,Username,AnswerID) Values ('"
  StrSql = StrSql &  title & "', '"
  StrSql = StrSql &  content & "', '"
  StrSql = StrSql & answertime & "', '"
  StrSql = StrSql & username & "', '"
  StrSql = StrSql &  ID & "' ) "
 
  my_conn.Execute StrSql
%>
<%
  strSQL = "Select * from Forum Where ID=" & ID 
  
  rst.CursorType=3
  
  rst.open strSQL
  
  count1=rst("AnswerCount")+1
  
  strSQL="Update Forum set AnswerCount="& "'"&count1&"'" & "where ID=" & ID
  
  my_conn.Execute strSQL
%>
<!--#include file="closedb.asp"-->
  <script language=vbscript>
     msgbox "你回复的帖子已发表",48,"发表成功" 
     window.location="index.asp" 
  </script>  

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?