Home > Backend Development > PHP Tutorial > PHP Tips: PHP Filters Dangerous HTML Code_PHP Tutorial

PHP Tips: PHP Filters Dangerous HTML Code_PHP Tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-21 14:57:23
Original
852 people have browsed it

Use PHP to filter code in HTML that may be exploited to introduce external dangerous content. Sometimes, it is necessary to allow users to submit HTML content in order to enrich the information posted by users. Of course, some codes that may cause confusion in the display page layout are also within the filtering scope.


#HTML posted by users, filtering dangerous codes

The following is the quoted content:
以下为引用的内容:
function uh($str)
{
$farr = array(
"/s+/", //过滤多余的空白
"/<(/?)(script|i?frame|style|html|body|title|link|meta|?|%)([^>]*?)>/isU", //过滤
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template