Problems with the PHP post array

Source: Internet
Author: User
My page is written like this:
The select here is just one of them, I have about 20 select controls
                              {#section name=one loop=11 start=10 step=-1#}                                    {# $smarty. section.one.index#}                   {#/section#}                      


Now I need to save the submitted information in the background:
if (Is_array ($_post[' ZB ')) && count ($_post[' ZB ']) >0) {for ($i =0; $i
   
  
Strange things come, obviously I have 10 select control, but submitted to the background, only 4 valid, the remaining 6 are all empty values, what is going on?


Reply to discussion (solution)

Print_r ($_post[' ZB ');
Post the results

Post the HTML code to see, Print_r ($_post); See what the value is.

if (!empty ($_post[' ZB '] [$i]))

There's something wrong with your judgment here.
Executes if the value of the control is not 0 or null or empty


If the value is 0, it will not be executed.


This is the result, the first few are worth it, and there's nothing behind it.

Look at the option for select in the page there is no value

Thank you very much, originally was the front desk to write wrong.

                              {#section name=one loop=11 start=10 step=-1#}                                    {# $smarty. section.one.index#}                   {#/section#}                      

The value in this is null
  • 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.