About SQL Injection Solutions

Source: Internet
Author: User
About SQL injection
I have a question, the site processing a message board, through the Ajax to the PHP controller to deal with
$.ajax ({
URL: ' http://www.************?content= ' + thiscontent + ' &username= ' + thisusername + ' &phone= ' +thisPhone+ ' &callback=? ',
Type: ' GET ',
DataType: ' Jsonp ',
Success:function (d) {
if (d.code==200) {

}
}
});
PHP side with get to pick up data, and then directly to the MySQL database, but the problem is, smart point directly in the browser address bar directly input http://www.************?content= ' + thiscontent + ' & Username= ' + thisusername + ' &phone= ' +thisphone+ ' &callback=? This way you can also insert data into the database.
If someone uses the software through the browser to give you uninterrupted data, then your MySQL must be a bird like this. Will surely break down. Do the experts have any good solution??? Ask for answers!
------Solution--------------------
Then make a limit. Message number per day based on user name username or IP limit
------Solution--------------------
Reference:
Quote: Reference:

Then make a limit. Message number per day based on user name username or IP limit

First of all thank you for your answer Oh!
I thought of the user name restrictions, but also to do so, but will not have a master to do a random username to MySQL, it is difficult to determine. Restricting IP is a good idea. But the feeling is not very common, is there a better way to solve it?

Is your site anonymous? Do not login restrictions?
Add Verification Code limit
------Solution--------------------
Leave a message before you make username judgment can see whether the user if it is a random fill on the return and not let him go down operation
References:
Quote: References:

Then make a limit. Message number per day based on user name username or IP limit

First of all thank you for your answer Oh!
I thought of the user name restrictions, but also to do so, but will not have a master to do a random username to MySQL, it is difficult to determine. Restricting IP is a good idea. But the feeling is not very common, is there a better way to solve it?
  • 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.