When creating a PHP project, you need to set the input tag to read-only, but the user can modify it in the browser. What should I do? When creating a PHP project, you need to set the input tag to read-only, but the user can modify it in the browser. What should I do?
Reply content:
When creating a PHP project, you need to set the input tag to read-only, but the user can modify it in the browser. What should I do?
You know, you never trust the data submitted by the user.
The front-end prohibition is only for the user experience. If you really need to filter user transmission, you only need to perform operations on the back-end. In this case, you don't need to worry about this when the backend performs data operations.Input
As long as the value in the database does not change, you can freely ~
Directly p a border that looks like input
Name is not added to input.
Not processed by the backend.
You can hide the real input and put it on false. Of course, the problem still exists. The key is background verification instead of relying on the browser.
What can I do when the backend selects data?
This is easy to do. It is also set the input attribute.
Chengin blog