asp html标签转换html编码

2015-08-12 16:02:39来源:作者:人点击

Function Xszh(zh)
if zh<>"" or not isnull(zh) then
 zh=replace(zh,"  ","&nbsp;&nbsp;")
 zh=replace(zh,"&euro;","'")
 ''zh=replace(zh,chr(13),"<br>")
 zh=lcase(zh)
 zh=replace(zh,"<table","&lt;table")
 zh=replace(zh,"<hr>","&lt;hr&gt;")
 zh=replace(zh,"<tr","&lt;tr")
 zh=replace(zh,"<%","&lt;%")
 zh=replace(zh,"<html>","&lt;html&gt;")
 zh=replace(zh,"<body","&lt;body")
 'zh=replace(zh,"<div","&lt;div")
 zh=replace(zh,"<iframe ","&lt;iframe")
 zh=replace(zh,"</iframe> ","&lt;iframe&gt;")
 zh=replace(zh,"</html>","&lt;/html&gt;")
 'zh=replace(zh,"<OBJECT","&lt;object")
 'zh=replace(zh,"<object","&lt;object")
 'zh=replace(zh,"</div>","&lt;/div&gt;")
 ''zh=replace(zh,"<span","&lt;span")
 'zh=replace(zh,"<script","&lt;script")
 zh=replace(zh,"<td","&lt;td")
 zh=replace(zh,"</table>","&lt;/table&gt;")
 zh=replace(zh,"<title>","&lt;title&gt;")
 zh=replace(zh,"</title>","&lt;/title&gt;")
 zh=replace(zh,"</body>","&lt;/body&gt;")
 zh=replace(zh,"<input","&lt;input")
 zh=replace(zh,"<!doctype","&lt;doctype")
 zh=replace(zh,"</tr>","&lt;/tr&gt;")
 zh=replace(zh,"</td>","&lt;/td&gt;")
 'zh=replace(zh,"<img","&lt;img")
 zh=replace(zh,"[img]","<img border=0 src=")
 zh=replace(zh,"[/img]",">")
 zh=replace(zh,"<text","&lt;text")
 zh=replace(zh,"<java","&lt;java")
 zh=replace(zh,"<a ","<a target=_blank ")
 zh=replace(zh,"</javascript>","&lt;/javascript&gt;")
 zh=replace(zh,"[url=","<a target=_blank href=")
 zh=replace(zh,"[/url]","</a>")
 xszh = zh
end if
End Function

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台