濮阳杆衣贸易有限公司

主頁 > 知識庫 > asp中實現(xiàn)清除html的函數(shù)

asp中實現(xiàn)清除html的函數(shù)

熱門標簽:鄭州語音電銷機器人官網(wǎng) 濰坊呼叫中心外呼系統(tǒng)供應(yīng)商 微信地圖標注有什么用 電銷機器人一個多少錢 不封卡外呼系統(tǒng)一般多少錢 地圖標注中心多少錢注冊 地圖標注不完整被罰款 北京大興區(qū)地圖標注 重慶外呼電銷系統(tǒng)費用

這個函數(shù)是必需要的,很多黑客來搗亂,黑掉數(shù)據(jù)庫,會注入大量的病毒js,在存儲和展示文本數(shù)據(jù)的時候,使用此函數(shù)過濾一下,可避免不少麻煩

clearhtml代碼

'清除HTML代碼
function clearhtml(content)
  content=replacehtml("#[^>]*;","",content)
  content=replacehtml("/?marquee[^>]*>","",content)
  content=replacehtml("/?object[^>]*>","",content)
  content=replacehtml("/?param[^>]*>","",content)
  content=replacehtml("/?embed[^>]*>","",content)
  content=replacehtml("/?table[^>]*>","",content)
  content=replacehtml("nbsp;","",content)
  content=replacehtml("/?tr[^>]*>","",content)
  content=replacehtml("/?th[^>]*>","",content)
  content=replacehtml("/?p[^>]*>","",content)
  content=replacehtml("/?a[^>]*>","",content)
  content=replacehtml("/?img[^>]*>","",content)
  content=replacehtml("/?tbody[^>]*>","",content)
  content=replacehtml("/?li[^>]*>","",content)
  content=replacehtml("/?span[^>]*>","",content)
  content=replacehtml("/?div[^>]*>","",content)
  content=replacehtml("/?th[^>]*>","",content)
  content=replacehtml("/?td[^>]*>","",content)
  content=replacehtml("/?script[^>]*>","",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("/?font[^>]*>","",content)
  content=replacehtml("/?h[^>]*>","",content)
  content=replacehtml("/?u[^>]*>","",content)
  content=replacehtml("/?i[^>]*>","",content)
  content=replacehtml("/?center[^>]*>","",content)
  content=replacehtml("/?center[^>]*>","",content)
  content=replacehtml("/?nobr[^>]*>","",content)
  content=replacehtml("/?clk[^>]*>","",content)
  content=replacehtml("/?muti[^>]*>","",content)
  content=replacehtml("/?/option[^>]*>","",content)
  content=replacehtml("/?o[^>]*>","",content)
  content=replacehtml("/?strong[^>]*>","",content)
  clearhtml=content
end 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

使用方法:

復(fù)制代碼 代碼如下:

%=clearhtml("div id="CodeTip">h2>分享代碼提示(2)/h2>ul>li style="font-weight: bold; color: rgb(170, 0, 0);">添加完代碼必須點擊“完成并查看”生效/li>li>準確的編程語言,可正確對代碼語法著色/li>li>輸入簡單幾個字的代碼片段說明/li>li>上傳源碼文件時無需再輸入說明/li>li>非程序相關(guān)文件將直接刪除,嚴重封帳號/li>li>圖片僅用來上傳截圖之類的文件,勿作他途/li>/ul>/div>")%>

以上就是本文所述的全部內(nèi)容了,希望大家能夠喜歡。

您可能感興趣的文章:
  • ASP 時間函數(shù)及如何獲取服務(wù)器時間的寫法
  • Asp Split函數(shù)之使用多個分割符的方法
  • asp與js的類型轉(zhuǎn)換函數(shù)介紹
  • asp中的Rnd 函數(shù)
  • ASP轉(zhuǎn)換格林威治時間函數(shù)DateDiff()應(yīng)用
  • ASP移動文件函數(shù)movefile權(quán)限不足的替代方法
  • ASP中實現(xiàn)的URLEncode、URLDecode自定義函數(shù)
  • asp實現(xiàn)獲取MSSQL數(shù)據(jù)庫表指定條件行數(shù)的函數(shù)
  • asp實現(xiàn)截取字符串函數(shù)
  • ASP實現(xiàn)強制圖片下載函數(shù)
  • ASP函數(shù)大全解析

標簽:汕頭 佛山 攀枝花 揭陽 鶴崗 海南 撫州 唐山

巨人網(wǎng)絡(luò)通訊聲明:本文標題《asp中實現(xiàn)清除html的函數(shù)》,本文關(guān)鍵詞  asp,中,實現(xiàn),清除,html,的,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《asp中實現(xiàn)清除html的函數(shù)》相關(guān)的同類信息!
  • 本頁收集關(guān)于asp中實現(xiàn)清除html的函數(shù)的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    东乡| 余干县| 东辽县| 上虞市| 旬阳县| 寿宁县| 龙井市| 延川县| 正定县| 塔城市| 安多县| 商城县| 宜州市| 伊春市| 锡林郭勒盟| 城口县| 盐边县| 瓦房店市| 定州市| 图们市| 浦江县| 陆丰市| 封开县| 屏山县| 安宁市| 左贡县| 若尔盖县| 德江县| 大渡口区| 南昌县| 灵宝市| 晴隆县| 南澳县| 阳东县| 天津市| 沈阳市| 海原县| 湛江市| 陵水| 梅河口市| 渭源县|