Programmer-the input tag needs to be read-only for PHP projects, but users can modify it in the browser. What should I do?

Source: Internet
Author: User
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.InputAs 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

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.