This article mainly introduces the CodeIgniter framework to filter HTML dangerous code. For more information, see the CI framework.
CodeIgniter provides several methods to filter HTML dangerous code. The most common methods are as follows:
1. you can use the htmlspecialchars () method for filtering.
2. you can set $ config ['global _ xss_filtering '] = FALSE in the config. php file under the config folder:
The code is as follows: $ config ['global _ xss_filtering '] = true;
However, this will increase the overhead of the server. So you can set it based on the situation.
3. you can set the second parameter in a post such as $ this-> input-> post ('content') to true:
The code is as follows: $ this-> input-> post ('content', true );
The above three methods can achieve simple data filtering, the specific use depends on the situation.