CodeIgniter framework filters HTML dangerous code_PHP tutorial

WBOY
Release: 2016-07-13 10:28:28
Original
863 people have browsed it

CodeIgniter actually has several methods for filtering dangerous HTML codes, the most common of which are as follows:

1. You can choose to use the htmlspecialchars() method to filter.

2. You can set $config['global_xss_filtering'] = FALSE; in the config.php file under the config folder to:

Copy code The code is as follows:
$config['global_xss_filtering'] = true;

But this setting will increase the server overhead. So set it according to the situation.

3. You can set the second parameter to true in a post like $this->input->post('content'):

Copy code The code is as follows:
$this->input->post('content', true);

The above three methods can achieve simple filtering of data, and the specific use depends on the situation.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/788605.htmlTechArticleCodeIgniter actually has several methods to filter HTML dangerous codes, the most common of which are as follows: 1. You can optionally use the htmlspecialchars() method to filter. 2. You can download the config folder...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template