To write a universal SQL Anti-flow module ~ I hope I can give you some ideas.

Source: Internet
Author: User
To write a generic SQL anti-injection module ~~~~~ hope to give some idea
Website input place More ~ ~ Each input place is deliberately to write a piece of code engineering volume is larger ~ ~ So I want to write a class ~ ~ when needed to introduce classes and functions to form onsubmit when checking input ~ ~ But each form input items are not the same ~ ~ So want to know if there is a universal SQL anti-injection module ~ ~ ~ How is the idea?

XSS also need to guard ~ ~ So also want to know a common XSS defense module is how ~ ~ Thank you thank you ~ ~


------Solution--------------------
Anti-injection can be consulted here
Http://www.w3school.com.cn/php/func_mysql_real_escape_string.asp

XSS prevention can be converted to HTML entities using Htmlspecialchars ().
------Solution--------------------
The common approach is to traverse the submitted data for content filtering.

  • Contact Us

    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

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.