1. 论坛系统升级为Xenforo,欢迎大家测试!
    排除公告

『精品ASP代码』:过虑HTML字符

本帖由 ydjjld2005-09-06 发布。版面名称:前端开发

  1. ydjjld

    ydjjld New Member

    注册:
    2005-09-06
    帖子:
    7
    赞:
    0
    '-----------------------------------------------------------
    '功能: 过虑HTML字符
    '输入:字符串
    '输出:经格式化后的字符串
    function HTMLEncode(fString)
    if not isnull(fString) then
    fString = replace(fString, ">", ">")
    fString = replace(fString, "<", "&lt;")

    fString = Replace(fString, CHR(32)&CHR(32), "&nbsp;&nbsp;")
    fString = Replace(fString, CHR(9), "&nbsp;")
    fString = Replace(fString, CHR(34), "&quot;")
    fString = Replace(fString, CHR(39), "'")
    fString = Replace(fString, CHR(13), "")
    fString = Replace(fString, CHR(10) & CHR(10), "</P><P> ")
    fString = Replace(fString, CHR(10), "<BR> ")

    HTMLEncode = fString
    end if
    end function
     
  2. 玄猫

    玄猫 New Member

    注册:
    2005-09-06
    帖子:
    3
    赞:
    0
    server.htmlencode()
     
  3. viewsnake

    viewsnake New Member

    注册:
    2005-09-05
    帖子:
    117
    赞:
    3
    好帖子,支持
     
  4. 秋风

    秋风 New Member

    注册:
    2005-09-06
    帖子:
    392
    赞:
    1
    好帖子,支持