asp中如何使form中textarea的中的换行符与空格能够写入数据库,读出时能够还原原来用户输入的格式?
我的网站是access数据库的,在网上也看了相关内容,但是不明白以下这段代码应该放在什么位置:<%functionHTMLEncode(fString)fString=r...
我的网站是access数据库的,在网上也看了相关内容,但是不明白以下这段代码应该放在什么位置:
<%
function HTMLEncode(fString)
fString = replace(fString, ">", ">")
fString = replace(fString, "<", "<")
fString = Replace(fString, CHR(32), " ")
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
fString = Replace(fString, CHR(10), "<BR>")
HTMLEncode = fString
end function
%>
按照你的说法我试过了,报错
错误类型:
Microsoft JScript 编译错误 (0x800A03F0)
缺少 '{'
/bbs/sl/ind1ex.asp, line 50
fString = replace(fString, ">", ">")
浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2) 展开
<%
function HTMLEncode(fString)
fString = replace(fString, ">", ">")
fString = replace(fString, "<", "<")
fString = Replace(fString, CHR(32), " ")
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
fString = Replace(fString, CHR(10), "<BR>")
HTMLEncode = fString
end function
%>
按照你的说法我试过了,报错
错误类型:
Microsoft JScript 编译错误 (0x800A03F0)
缺少 '{'
/bbs/sl/ind1ex.asp, line 50
fString = replace(fString, ">", ">")
浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2) 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询