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

📄 add.asp

📁 与asp相关的技术 如数据库和网页设计 很有用的哦
💻 ASP
字号:
<% response.buffer=true%>
<%
if session("user_type")<>"S" then
	response.redirect "../../../index.asp"
end if
%>
<!--#INCLUDE FILE="../../../system/odbc_connection.asp"-->
<%
	If request("submit")="  取  消  " Then
		Response.redirect "index.asp"
	End If
	dim writer_id,title,body,reader_id,back_flag
	back_flag=request("thename2")
	writer_id=session("user_id")
	title=request.form("title")
	body=request.form("body")
	reader_id=request.form("to_user_1")
	if reader_id="本课程所有人" then
		reader_id=session("lesson_id")
	end if
	
	writer_type=session("user_type")
	email_open=request("email_open")

	Dim SQL,sValues
	SQL = "Insert into guest(writer_id"
	sValues = "values('" & writer_id & "'"
	SQL = SQL & ",title"
	sValues = sValues & "," & "'" & title & "'"
	SQL = SQL & ",submit_date"
	sValues = sValues & "," & "'" & date & "'"
	SQL = SQL & ",writer_type"
	sValues = sValues & ",'"  & writer_type & "'"
	if body<>"" then
		SQL = SQL & ",body"
		sValues = sValues & "," & "'" & body & "'"
	end if
	if email_open<>"" then
		SQL = SQL & ",email_open"
		sValues = sValues & "," &  int(email_open)
	end if
	SQL = SQL & ",reader_id"
	sValues = sValues & "," & "'" & reader_id & "'"
	SQL = SQL & ",lesson_id"
	sValues = sValues & "," & "'" & session("lesson_id") & "'"
	SQL = SQL & ") " & sValues & ")"
	db.Execute(SQL)
	if email_open=0 then 
		response.redirect "index.asp"
	else
		sql="select guest_id from guest where writer_id='" & session("user_id") & "' order by guest_id desc"
		set rs=db.execute(sql)
		dim guest_id
		guest_id=rs("guest_id")
		db.close
		set db=nothing
		response.redirect "email.asp?guest_id=" & guest_id
	end if
%>

⌨️ 快捷键说明

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