www.gusucode.com > ASP+ACCESS在线教育系统设计(源代码+论文) > ASP+ACCESS在线教育系统设计(源代码+论文)\王智_在线教育系统\insertproblem.asp

    <%@  Language = "VBScript"  %>
<!-- #Include file="include\adovbs.inc" -->
<!-- #Include file="include\cod_ado.inc" -->
<%
	strTitle = Request.Form("title")
	strTitle = Trim(strTitle)
	strTitle = replace(strTitle,"'","''")
	
	strTitle = server.HTMLEncode(strTitle)
	'strTitle = replace(strTitle,"<","&lt;")
	'strTitle = replace(strTitle,">","&gt;")

	strText = Request.Form("problem")
	strText = replace(strText,"'","''")
	
	'strText = server.HTMLEncode(strText)
	'strText = replace(strText,chr(13)&chr(10),"<br>")
	'strText = replace(strText," ","&nbsp;")

	strText = replace(strText,"<","&lt;")
	strText = replace(strText,">","&gt;")
	
	set conn = server.CreateObject("adodb.connection")
	conn.Open Application("dsn")
	
	strSQL = "insert into problems(title,detail) values ('" &strTitle & "','" & strText & "')"
	'Response.Write strSql
	conn.Execute(strSQL)  

	conn.close
	set conn = nothing

	response.redirect "problem.asp"		
%>