但是如果把<%=outhtml(news("news"))%>换成<%news("news")%>的话,显示的全是<table>之类的表格代码,我还加了一段过滤字符是这样的
<%
'==================================================
' 函数名:inhtml(strhtml,en),outhtml(strhtml),delhtml(strhtml)
' 作 用:html过滤
' 参 数:strhtml
'==================================================
dim character_A
character_A = "|<|>|chr(32)|chr(9)|chr(34)|chr(39)|chr(13)|chr(10)&chr(10)|chr(10)| "
character_A = split(character_A,"|")
dim character_B
character_B = "|<|>| | |"|'| |</p><p>|<br />| "
character_B = split(character_B,"|")
dim character_C
character_C = "|<|>| | |"|'| |</p><p>|<br />| "
character_C = split(character_C,"|")
dim character_cn
character_cn = "|‘|’|“|”"
character_cn = character_cn & "|,|。|!|?|:|;|、"
character_cn = character_cn & "|(|)|【|】|『|』|《|》"
character_cn = character_cn & "|+|-|×|÷"
character_cn = character_cn & "|~|◎|#|¥|%|……|※|——|§"
character_cn = split(character_cn,"|")
dim character_en
character_en = "|'|'|"|"""
character_en = character_en & "|,|.|!|?|:|;|,"
character_en = character_en & "|(|)|[|]|{|}|<|> "
character_en = character_en & "|+|-|*|\"
character_en = character_en & "|~|@|#|$|%|^|&|-|\"
character_en = split(character_en,"|")
'=======
''
'inhtml(strhtml,0)
'
function inhtml(strhtml,en)
if not isnull(strhtml) then
strhtml = trim(strhtml)
for i = 1 to UBound(character_A)
strhtml = replace(strhtml, character_A(i), character_B(i))
next
if int(en)=1 then '转换成英文字符
for i = 1 to UBound(character_cn)
strhtml = replace(strhtml, character_cn(i), character_en(i))
next
end if
strhtml = replace(strhtml, "<p align="left">", "<p>")
inhtml = strhtml
end if
end function
function outhtml(strhtml)
if not isnull(strhtml) then
strhtml = trim(strhtml)
for i = 1 to UBound(character_B)
strhtml = replace(strhtml, character_B(i), character_C(i))
next
outhtml = strhtml
end if
end function
function delhtml(strhtml)
dim objregexp, stroutput
set objregexp = new regexp
objregexp.ignorecase = true
objregexp.global = true
objregexp.pattern = "(<[a-za-z].*?>)|(<[\/][a-za-z].*?>)"
stroutput = objregexp.replace(strhtml, "")
' stroutput = replace(stroutput, "<", "<")
' stroutput = replace(stroutput, ">", ">")
delhtml = stroutput
set objregexp = nothing
end function
%>
这样的话表格的样子已经出来了,就是不显示边框线(我设的边框为1)