当前位置:首页 > 建站常识 > 列表

asp中实现清除html的函数,asp清除html函数

点击:时间:2017/12/11关键词:上海网页设计 上海网站优化
这个函数是必需要的,很多黑客来捣乱,黑掉数据库,会注入大量的病毒js,在存储和展示文本数据的时候,使用此函数过滤一下,可避免不少麻烦clearhtml代码'清除HTML代码function clearhtml(content) content=replac

<a href=https://www.021jianzhan.com/tags/shanghaiwangyesheji/><strong>上海网页设计</strong></a>公司

这个函数是必需要的,很多黑客来捣乱,黑掉数据库,会注入大量的病毒js,在存储和展示文本数据的时候,使用此函数过滤一下,可避免不少麻烦

clearhtml代码

'清除HTML代码function clearhtml(content)  content=replacehtml("&#[^>]*;","",content)  content=replacehtml("]*>","",content)  content=replacehtml("]*>","",content)  content=replacehtml("]*>","",content)  content=replacehtml("]*>","",content)  content=replacehtml("]*>","",content)  content=replacehtml(" ","",content)  content=replacehtml("]*>","",content)  content=replacehtml("]*>","",content)  content=replacehtml("]*>","",content)  content=replacehtml("]*>","",content)  content=replacehtml("]*>","",content)  content=replacehtml("]*>","",content)  content=replacehtml("]*>","",content)  content=replacehtml("]*>","",content)  content=replacehtml("]*>","",content)  content=replacehtml("]*>","",content)  content=replacehtml("]*>","",content)  content=replacehtml("]*>","",content)  content=replacehtml("(javascript|jscript|vbscript|vbs):","",content)  content=replacehtml("on(mouse|exit|error|click|key)","",content)  content=replacehtml("<\\?xml[^>]*>","",content)  content=replacehtml("<\/?[a-z]+:[^>]*>","",content)  content=replacehtml("]*>","",content)  content=replacehtml("]*>","",content)  content=replacehtml("]*>","",content)  content=replacehtml("]*>","",content)  content=replacehtml("]*>","",content)  content=replacehtml("]*>","",content)  content=replacehtml("]*>","",content)  content=replacehtml("]*>","",content)  content=replacehtml("]*>","",content)  content=replacehtml("]*>","",content)  content=replacehtml("]*>","",content)  content=replacehtml("]*>","",content)  clearhtml=contentend function


replacehtml代码
function replacehtml(patrn,strng,content)    if isnull(content) then    content=""  end if  set regex=new regexp  regex.pattern=patrn  regex.ignorecase=true  regex.global=true  replacehtml=regex.replace(content,strng)end function
预约建站
免费提供网站优化
领取关键词