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
This article mainly introduces the web security anti-SQL injection is a multi-filter with PHP filter function, has a certain reference value, now share to everyone, the need for friends can refer to
SQL injection and cross-site attack filtering functions support common Security filtering such as SQL injection, cross-site scripting attacks, and cross-site post su
, 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
PHP filter form submits special characters (anti-injection ). This article will summarize some common methods for preventing php injection and SQL injection in php, htmlspecialcharsaddslashesstripslashesstrip_tagsmysql_re is provided in php. This article will summarize some common php injection prevention and SQL injection methods, htmlspecialchars/addslashes/stripslashes/strip_tags/mysql_real_escape_string
The filter of a small anti-leech image can be used together
Public class imageredirectfilter implements filter {
Public void Init (filterconfig config) throws servletexception {}
Public void dofilter (servletrequest req, servletresponse res,Filterchain chain) throws ioexception, servletexception {
Httpservletrequest request = (httpservletrequest) req;H
The code I wrote today was read to the project manager because it didn't take into account the problem of SQL injection, and then when he tested my code, he hit a "'" and my program hung up!
So I found a jquery! on the internet that validates and filters the text box.
First figure:
PS: Here with @ #测试, because ' too small, can not see clearly!
Specific jquery code:
This is in the form of a bullet box!
$ (document). Ready (function () {//
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.