$ _ GET $ _ POST whether it is necessary to encapsulate functions at the underlying system to verify the data when receiving the data

Source: Internet
Author: User
In general, I personally prefer to use $ _ GET [& #039; parameter & #039;] for code writing. Is it necessary to encapsulate a function at the underlying system level, to determine whether to pass the value or whether the isset is empty or not, or when necessary, directly verify on the program page. System underlying encapsulation... in general, I personally prefer to directly use $ _ GET ['parameter'] for code writing. Is it necessary to encapsulate a function at the underlying system level, to determine whether to pass the value or whether the isset is empty or not, or when necessary, directly verify on the program page.

Is it necessary to encapsulate the underlying system? The two are more efficient @!

Reply content:

In general, I personally prefer to directly use $ _ GET ['parameter'] for code writing. Is it necessary to encapsulate a function at the underlying system level, to determine whether to pass the value or whether the isset is empty or not, or when necessary, directly verify on the program page.

Is it necessary to encapsulate the underlying system? The two are more efficient @!

I think it is necessary. First, the data sent from the front end is not secure. Second, there will be a large number of get and post requests in the entire website. If each request requires verification and security filtering, it will add a lot of complicated processes, and it is much easier to directly encapsulate a function to call it.

Many frameworks provide the function of retrieving and filtering input parameters. If you ask this question, there will not be any architecture...
Since everyone has this function, it is enough to prove that this function is more advantageous than the disadvantage.

If your framework does not contain these functions, you must filter them out.

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.