Is there any good suggestions for mysql security on the msyql-php interface?

Source: Internet
Author: User
In the past, the front-end PHP was used for simple logic and output, and the backend layer php was used for data interfaces, so there was no worry that the front-end was exposed by backend mysql. But now I want to change the front-end to JS. If I want to expose the api layer and worry about mysql security issues, let's take a look at some good practices to avoid such problems... in the past, the front-end PHP was used for simple logic and output, and the backend layer php was used for data interfaces, so there was no worry that the front-end was exposed by backend mysql.
But now I want to change the front-end to JS. If I want to expose the api layer and worry about mysql security issues, can you see any good practices to avoid such problems?

Reply content:

In the past, the front-end PHP was used for simple logic and output, and the backend layer php was used for data interfaces, so there was no worry that the front-end was exposed by backend mysql.
But now I want to change the front-end to JS. If I want to expose the api layer and worry about mysql security issues, can you see any good practices to avoid such problems?

... It can still be encapsulated by the backend php, but the request is changed to ajax .. The data format used by ajax is json.

Js calls php and php accesses mysql again.

Don't say you areSQL. php? SQL = select * from tableThis access form.

If yes, it will not be saved.
If not, php controls the security of data access, including cookies and one-time tokens.

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.