PHP Security Knowledge-verification data-PHP Tutorial

Source: Internet
Author: User
Verification data of PHP security knowledge. Your users may be excellent, and most users may use the application as expected. However, as long as the input opportunity is provided, it is very likely that you will be very good at learning your users, and most users may use the application as expected. However, as long as the input opportunity is provided, there may be very bad input. As an application developer, you must prevent the application from receiving incorrect input. Careful consideration of the locations and correct values entered by the user will allow you to build a robust and secure application.

The following lists general verification tips for various verification data:

Use values in the whitelist

Always reverify limited options

Use built-in escape functions

Verify the correct data type (such as numbers)

The value (White-listed value) in the whitelist is the correct value, which is opposite to the invalid Black-listed value. The difference between the two is that when verifying data, the list or range of possible values is smaller than the list or range of invalid values, many of which may be unknown values or unexpected values.

When verifying data to ensure PHP Security, remember that it is generally easier to design and verify the value that the application allows to use than to prevent all unknown values. For example, to limit the field value to all numbers, you need to write a routine to ensure that all input values are numbers. Do not compile a routine that is used to search for non-numeric values and is marked as invalid when a non-numeric value is found.


Your users may be excellent, and most users may use the application as expected. However, as long as the input opportunity is provided, it is very likely that...

Related Article

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.