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

📄 update.asp

📁 在线考试系统
💻 ASP
字号:
<%@ Language=VBScript %>

<% option explicit %>

<% Response.Buffer =true %>

<!-- #include file="conn_forum.asp" -->
<!-- #include file="conn_member.asp" -->
<!-- #include file="inc_session.asp" -->

<%
	dim uid
	dim iArea
	dim iParentId
	dim iId
	dim sTitle
	dim sFace
	dim sContent

	uid=GetSession()

	iArea=CLng(Request("areaid"))
	iParentId=CLng(Request("parentid"))
	iId=CLng(Request("tid"))
	
	sTitle=RemoveBad(trim(Request("Title")))
	sFace=clng(Request("face"))
	sFace="f" & Right("000" & sFace,3) & ".gif"
	sContent=Request("content") & vbcrlf & vbcrlf & vbcrlf & "[原内容已经被作者修改过," & Now() & "]"

	'-------------------------- Check all blank ------------------
	if sContent="" or (iId=-1 and sTitle="") then
		%>
		<script language="VBScript">
			history.back
		</script>
		<%
		Response.End
	end if

	if uid="" then
		%>
		<script language="VBScript">
			history.back
			window.open "relogin.asp","ReLogin","width=300,height=230,status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=no"
		</script>
		<%
		Response.End
	end if

	'====================== Start update =====================

	dim rs
	set rs=Server.CreateObject ("ADODB.Recordset")

	'------- Update theme -------
	rs.Open "SELECT * FROM tContent WHERE ThemeId=" & iId,connf,3 ,3

	if rs.BOF and rs.EOF then
		Response.Write "theme error!"
		Response.End
	end if

	if rs("lock")=1 then
		response.Write "theme had locked!"
		Response.End
	end if

	if iId=-1 then
		rs("date")=date()
		rs("time")=time()
	end if

	rs("Theme")=sTitle
	rs("content")=sContent
	rs("icon")=sFace
	rs.Update
	rs.Close

	'------------------------
	Response.Redirect "viewtheme.asp?area=" & iArea & "&id=" & iParentId

%>

<%

Function RemoveBad(ori)
	dim ns
	if len(ori)=0 then exit function
	ns=Replace(ori,"&","&amp;")
	ns=Replace(ns,"<","&lt;")
	ns=Replace(ns,">","&gt;")
	ns=Replace(ns,vbcrlf,"<br>")
	ns=Replace(ns,chr(34),"&quot;")
	RemoveBad=ns
End Function

%>



⌨️ 快捷键说明

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