Well, for PHP developers, a PHP SQL anti-injection and character filtering and a variety of filter code OH.
Well, for PHP developers, a PHP SQL anti-injection and character filtering and a variety of filter code OH.
= = anti-injection automatic filtering [post-activation pro
yesterday, but there was no significant change in IP addresses and PVS. For about one day, I took a simple anti-leech protection, the result will return to normal after several minutes. My method is to use the rewrite component, and all my friends who use the discuz forum and static pages know that the following is a simple way to describe in the text-and-text layout. Since there is no technical content, you can make a brick.
1. Download the rewrite
Original address: http://www.cnblogs.com/QLeelulu/archive/2008/10/13/1310419.htmlIn the previous article we've learned about action filter and the built-in filter implementation, and now we're going to write an instance. Just write a filter for the anti-theft chain.First inherits from the FilterAttribute class implemen
In the previous article we've learned about action filter and the built-in filter implementation, and now we're going to write an instance. Just write a filter for the anti-theft chain.First inherits from the FilterAttribute class implements the Iactionfilter interface simultaneously, the code is as follows:Anti-theft
to mask the form of normal input, use this feature please note.
Filterchain.dofilter (New Requestwrapper (HttpServletRequest) servletrequest), servletresponse);
} requestmapping:public Requestwrapper () {super (NULL);
Public Requestwrapper (HttpServletRequest httpservletrequest) {super (httpservletrequest);
Public string[] Getparametervalues (string s) {string str[] = Super.getparametervalues (s);
if (str = null) {return null;
int i = str.length;
String as1[] = new String[i];
for
picture address before adding "Domain/path/pic.asp?url=" can be. For the file resources of the anti-theft chain, you can use the method of human-referenced pages to solve the problem cannot be downloaded, such as to obtain the address of the http://www.z7z8.com.cn/old/pic.zip, the download found the use of anti-theft chain technology, when the new download task can be artificially added " Reference page: "
Copy CodeThe code is as follows:
PHP Whole station Anti-injection program, need to require_once this file in public fileJudging MAGIC_QUOTES_GPC Statusif (@get_magic_quotes_gpc ()) {$_get = sec ($_get);$_post = sec ($_post);$_cookie = sec ($_cookie);$_files = sec ($_files);}$_server = sec ($_server);Function sec ( $array) {If it is an array, iterate through the array, calling recursivelyif (Is_array ($array)) {foreach ($array as $k = = $v) {$array
($DATA) can be written directly to the database for advanced trusted users, addslashes cannot intercept single quotes that use 0xbf27 instead, so it is best to use Mysql_real_escape_ The string or mysql_escape_string is escaped, but the backslash must be stripped before escaping (assuming Addslashes is turned on by default).
The code is as follows
Copy Code
function Fnescapestr ($data){if (GET_MAGIC_QUOTES_GPC ()){$data = Stripslashes ($value);}$data = "'". Mysql_esc
Copy CodeThe code is as follows:
PHP Whole station Anti-injection program, need to require_once this file in public file
Judging MAGIC_QUOTES_GPC Status
if (@get_magic_quotes_gpc ()) {
$_get = sec ($_get);
$_post = sec ($_post);
$_cookie = sec ($_cookie);
$_files = sec ($_files);
}
$_server = sec ($_server);
Function sec ( $array) {
If it is an array, iterate through the array, calling recursively
if (Is_array ($array)) {
foreach ($array as $k = = $v
Copy Code code as follows:
? Php
PHP Whole station Anti-injection program, need to require_once the document in the public file
Judge the state of MAGIC_QUOTES_GPC
if (@get_magic_quotes_gpc ()) {
$_get = sec ($_get);
$_post = sec ($_post);
$_cookie = sec ($_cookie);
$_files = sec ($_files);
}
$_server = sec ($_server);
Function sec ( $array) {
If it's an array, iterate through the array, recursively call the
if (Is_array ($array)) {
Here we will tell you about the php anti-injection code method, filter all GETPOST, because most of the data can be injected through the getpost method, of course, there are files .? Php filters all GET requests... here we will tell you about php anti-injection code methods and filter all get post requests, because mos
Photoshop CC just released by the great God to crack, the cat immediately download the use. Now put this new version of the filter introduced to everyone, but also remember when the CS6 released to the fuzzy technology-"anti-filter" Mody, is this "stabilization."
Open a picture and click on the "Filter" me
Php anti-SQL injection filtering code. We provide three letters to filter out some special characters, mainly using php to filter out SQL sensitive strings. let's take a look at this code. If you have any need, we have provided three letters to filter out some special characters. we mainly used php to
, HTML tags, links, unblocked HTML tags, database syntax error tolerance, JS execution judgment, PHP Execution judgment, multiple consecutive carriage return line breaks and spaces. Some of these concepts are inclusive.
Ii. Data Processing for form submission1. Force Add a backslash
Because some hosts enable the magic reference get_magic_quotes_gpc by default, and some may disable it, it is best to add a backslash to the program. This can be processed in a unified manner. The characters include
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.