
asp过滤HTML,上传到空间怎么网页的内容(HTML)全部过滤了,整个网页出现空白。
asp过滤HTML,上传到空间怎么网页的内容(HTML)全部过滤了,整个网页出现空白。但是换到别的空间就可以正常使用了。请问是不是空间的问题呢?<%'文章前110字,包空...
asp过滤HTML,上传到空间怎么网页的内容(HTML)全部过滤了,整个网页出现空白。但是换到别的空间就可以正常使用了。请问是不是空间的问题呢?
<%
' 文章前110字,包空格
function nohtml(str)
if trim(str)<>"" then
dim re
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
re.Pattern="(<.+?>)"
str=re.replace(str,"")
re.Pattern="(\<\/[^\<]*\>)"
str=re.replace(str," ")
str=replace(str," ","")
str = replace(str, " ", "")
str=replace(str,"<br>","")
str=replace(str,"<p>","")
str=replace(str," ","")
str = Replace(str, CHR(32), "")
str = Replace(str, CHR(9), "")
str = Replace(str, CHR(34), "")
str = Replace(str, CHR(39), "")
str = Replace(str, CHR(13), "")
str = Replace(str, CHR(255), "")
str = Replace(str, CHR(10), "")
str = Replace(str, CHR(11), "")
str = Replace(str, CHR(12), "")
nohtml=str
set re=nothing
end if
end function
%>
怕知道过滤了代码再附上图片
下面是出现过滤后的内空代码
<%
if nohtml(rsf2("content"))="" then
response.write ""& cutstr(rsf2( "title"),80) &""
else
response.write left(nohtml(rsf2("content"))&"",80)&"..."
end if
%> 展开
<%
' 文章前110字,包空格
function nohtml(str)
if trim(str)<>"" then
dim re
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
re.Pattern="(<.+?>)"
str=re.replace(str,"")
re.Pattern="(\<\/[^\<]*\>)"
str=re.replace(str," ")
str=replace(str," ","")
str = replace(str, " ", "")
str=replace(str,"<br>","")
str=replace(str,"<p>","")
str=replace(str," ","")
str = Replace(str, CHR(32), "")
str = Replace(str, CHR(9), "")
str = Replace(str, CHR(34), "")
str = Replace(str, CHR(39), "")
str = Replace(str, CHR(13), "")
str = Replace(str, CHR(255), "")
str = Replace(str, CHR(10), "")
str = Replace(str, CHR(11), "")
str = Replace(str, CHR(12), "")
nohtml=str
set re=nothing
end if
end function
%>
怕知道过滤了代码再附上图片
下面是出现过滤后的内空代码
<%
if nohtml(rsf2("content"))="" then
response.write ""& cutstr(rsf2( "title"),80) &""
else
response.write left(nohtml(rsf2("content"))&"",80)&"..."
end if
%> 展开
2个回答
展开全部
跟你的代码无关,不信你试试把nohtml()函数去掉再运行看看
追问
问题解决了,还是代码的问题!
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询