Write a general SQL anti-inbound module ~ Hope you can give me some ideas
Source: Internet
Author: User
Write a general SQL anti-Injection module ~~~~~ I hope I can enter more information for my website ~~ Each input part specifically writes a piece of code with a large amount of work ~~ So I want to write a class ~~ When necessary, we will introduce classes and functions to check the input when the form is onsubmit ~~ However, the input items of each form are different ~~ So I want to know if there is a general SQL anti-Injection module ~~~ What is the idea? Write a general SQL anti-Injection module ~~~~~ Hope you can give me some ideas
There are many website inputs ~~ Each input part specifically writes a piece of code with a large amount of work ~~ So I want to write a class ~~ When necessary, we will introduce classes and functions to check the input when the form is onsubmit ~~ However, the input items of each form are different ~~ So I want to know if there is a general SQL anti-Injection module ~~~ What is the idea?
XSS also needs prevention ~~ So I also want to know what a common XSS defense module is like ~~ Thank you ~~
------ Solution --------------------
For anti-injection, refer to here
Http://www.w3school.com.cn/php/func_mysql_real_escape_string.asp
XSS prevents HTML SpecialChars () from being converted to HTML objects.
------ Solution --------------------
A common method is to traverse submitted data for content filtering.
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service