All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
用javascript实现页面无刷新更新数据_JavaScript技术_编程技术
成为PHP高手,学会懒惰地用PHP编程_php资料_编程技术
ASP.NET2.0服务器控件开发之实现事件_[Asp.Net教程]
.NET的视图状态ViewState与Request.Form及string和String的区别_[Asp.Net教程]
ASP.NET,2.0的异步页面刷新_[Asp.Net教程]
TechED,VS2008课件_[Asp.Net教程]
ASP.NET3.5的ListView与CSS,Friendly_.net资料_编程技术
Asp.net动态生成页面控件的办法_[Asp.Net教程]
.NET,2.0数据绑定原理_[Asp.Net教程]
Xml学习笔记(二)Javascript篇_[XML教程]
Reading number is top 10 pictures
Group of female porn in 《westwards》, uninhibited woman threatened to not the bottom line2
The money of more than 100 countries and regions13
Plump breasts1
The money of more than 100 countries and regions6
影评-疯子,我爱你
The money of more than 100 countries and regions5
美丽的少女1
这才是真正的人体艺术2
美女挤公交
小学生考试又现神作--还有外国的
Download software ranking
Love the forty days
Tram sex maniac 2 (H) rar bag12
Tram sex maniac 2 (H) rar bag4
The Bermuda triangle1
The Bermuda triangle2
SP3 for SQL2000
Boxer vs Yellow5
linux高级编程
在线棋牌游戏3.05版
Visual C++界面编程技术
归海一刀 published in(发表于) 2014/2/17 7:35:56 Edit(编辑)
PHP技巧:php过滤危险html代码_[PHP教程]

PHP技巧:php过滤危险html代码_[PHP教程]

PHP技巧:php过滤危险html代码_[PHP教程]


用PHP过滤html里可能被利用来引入外部危险内容的代码。有些时候,需要让用户提交html内容,以便丰富用户发布的信息,当然,有些可能造成显示页面布局混乱的代码也在过滤范围内。



#用户发布的html,过滤危险代码
function uh(str)
{
farr = array(
"/\s+/", //过滤多余的空白
"/<(\/?)(scrīpt|i?frame|style|html|body|title|link|meta|\?|\%)([^>]*?)>/isU", //过滤 "/(<[^>]*)on[a-zA-Z]+\s*=([^>]*>)/isU", //过滤javascrīpt的on事件

);
tarr = array(
" ",
"<\\1\\2\\3>", //如果要直接清除不安全的标签,这里可以留空
"\\1\\2",
);


str = preg_replace( farr,tarr,str);
return str;
}







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.