⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readd.asp

📁 asp开发 asp开发 asp开发 asp开发
💻 ASP
字号:
	<!--#Include file="odbc_connection.asp"-->
	<!--#Include file="function.asp"-->
	<%
	Dim body,hits,user_id,father_id,first_id,IP             
	title=myReplace(Request.Form("title"))                '返回文章标题
	body=myReplace(Request.Form("body"))                  '返回文章内容
	user_id=myReplace(Request.Form("user_id"))            '返回作者姓名
	user_email=myReplace(Request.Form("user_email"))      '返回作者email
	hits=0                                                '点击数为0
	forum_id=Session("forum_id")                          '论坛编号
	IP=Request.ServerVariables("REMOTE_ADDR")             'IP地址
	father_id=Request.Form("father_id")                   '返回父文章的father_id字段值
	first_id=Request.Form("first_id")                     '返回父文章的first_id子段值

	'以下将文章保存到数据库
	Dim sqla,sqlb,strSql
	sqla = "Insert Into bbs(title,hits,user_id,submit_date,forum_id,ip"
	sqlb = "Values('" & title & "'," & hits & ",'" & user_id & "',#" & Now() & "#," & forum_id & ",'" & IP & "'"
	If body<>"" Then                               '如果文章内容不为空,则添加内容
		sqla = sqla & ",body"
		sqlb = sqlb & ",'" & body & "'"
	End If
	If user_email<>"" Then                                 '如果有email,则添加
		sqla = sqla & ",user_email"
		sqlb = sqlb & ",'" & user_email & "'"
	End If
	strSql = sqla & ") " & sqlb & ")"
	db.Execute(strSql)

	'下面首先获取本文章的记录编号
	Dim rs,id
	strSql="Select Top 1 id From bbs Where title='" & title & "' And user_id='" & user_id & "' Order By id desc"
	Set rs=db.Execute(strSql)
	id=rs("id")

	'下面将更新该文章的父记录编号father_id和第1层记录编号first_id
	strSql="Update bbs Set father_id='" & father_id & GetFatherCode(id) & "',first_id=" & first_id & " Where id=" & id
	db.Execute(strSql)

	'下面两句将本栏目的文章数目加1
	strSql="update forum set forumcount=forumcount+1 where ID = " & forum_id
	db.Execute(strSql)

	'重定向回主页面
	Response.Redirect "bbslist.asp"
	%>

⌨️ 快捷键说明

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