PHP: Print post data, return the issue with a length of not 1 but the content is empty

Source: Internet
Author: User

Problem:

First, the HTML looks like this:

We can see that the name value of the textarea tag is cten, so we check to see if the post is getting the data properly:

  

Background to get:

 

Result: We can get the data normally

  

Next, we make a judgment: to determine whether the user is empty, is empty, you are prompted that it cannot enter empty data, otherwise display the input data :

  

We deliberately do not enter data :

Results:

As we can see, the system does not enter the IF statement judgment, but executes the code of Var_dump ($_post), and the displayed length is 21 instead of 1:

So this is why, since it is not the post reason that is the reason for the HTML, to see the HTML code, found that:

  

Workaround:

  

To submit the empty data again:

  

Results:

When when, the problem solved, knock happy, thank the friend who gave me a hint!

END

PHP: Print post data, return the issue with a length of not 1 but the content is empty

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.