数据库字段内容存在'、"、>、<等特殊字符,转义html字符输出
2016-04-16 16:10
811 查看
GuestBook_Content=<span style='font: 14px/24px arial, 宋体, sans-serif, tahoma, "Microsoft YaHei"; color: rgb(69, 69, 69); text-transform:none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; float: none; display: inline !important; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;'>“你好”这个词是在面对普通人,普通朋友,或者同学等一些关系比较普通的人所使用的语气词;</span>
//替换特殊字符
function HTMLEncodes(fString)if not isnull(fString) thenfString = Replace(fString, ">", ">")fString = Replace(fString, "<", "<")fString = Replace(fString, """, CHR(34))fString = Replace(fString, "'", CHR(34)) fString = Replace(fString, " ", CHR(32)&CHR(32)) fString = Replace(fString, " ", CHR(32))fString = Replace(fString, "<br>", CHR(10)) fString = Replace(fString, "", CHR(13)) HTMLEncodes = fStringend ifend function
response.Write HTMLEncodes(ZXFD_GuestBook_Content)
<span style='font: 14px/24px arial, 宋体, sans-serif, tahoma, "Microsoft YaHei"; color: rgb(69, 69, 69); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; float: none; display: inline !important; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;'>“你好”这个词是在面对普通人,普通朋友 ,或者同学等一些关系比较普通的人所使用的语气词;</span>
相关文章推荐
- MySQL常用操作
- 用sql语句取设置了置顶的记录
- mysql 5.5.x zip直接解压版安装方法
- python连接redis002
- Redis--开发 Spring Redis 应用程序
- MySQL:基础命令(慢慢累积)
- sql 删除表中多余的重复记录(多个字段),只保留一条记录
- python连接redis文档001
- sql 语句
- impdp导入到数据库
- Redis--常用数据类型
- MariaDB扩展特性--虚拟列
- mysql中的当前时间函数
- CodeSmith和PowerDesigner的使用安装和数据库创建
- Mysql 复习
- MySQL安装未响应解决方法
- mysql zip 安装
- oracle用户默认表空间
- MySQL安装
- 在centos6.7下安装oracle11gR2的示例数据库