PHP Anti-SQL code, how to solve

Source: Internet
Author: User
Tags php mysql
PHP Anti-SQL code
Recently in learning, PHP MySQL
Next, after submitting the form, between inserting the database,
Is that enough to write? Do you want to write any other anti-SQL code?
$name =mysql_real_escape_string ($_post[' name ');

------to solve the idea----------------------
Baidu "360 Universal anti-injection" can be used as a reference
------to solve the idea----------------------
That's all you have to say.
------to solve the idea----------------------
References:
Quote: References:

Baidu "360 Universal anti-injection" can be used as a reference

O (∩_∩) o Thank you

Is there something wrong with me writing this?

OK
------to solve the idea----------------------
I've just learned. I think directly to learn PDO, with parameter query. Anyway, it's just starting to learn.
------to solve the idea----------------------
General use addslashes function; mysql_real_escape_string must be connected to the database before it can be used
------to solve the idea----------------------
1. The user's data must be digitally verified as a number
2.addslashes function
3.mysql_real_escape_string or Mysql_escape_string
4. Precompiled SQL Prepare
------to solve the idea----------------------
I think the use of 360safe is still good, there is time to study!!
  • 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.