In foreach, how does php submit a form to another page?

Source: Internet
Author: User
The Code is as follows: & amp; lt ;? Phpforeach ($ userinfoas $ key & amp; gt; $ value) {code...} & amp; lt ;? & Amp; gt; & amp; lt; inputtype & quot; text & quot; value & quot; & amp; lt ;? Phpecho $ merch-& amp; gt; merch_id ;? & Amp; gt; & quot; & amp; gt; & amp; lt; formid & quot; modity & quot; method & quot; the Code is as follows:
Foreach ($ userinfo as $ key => $ value ){

   $user=(object)$value; 

}
?>

Why is the input value $ _ POST ['device _ id'] submitted to another page always the value in the first row of the table? The onclick event using tag a cannot pass the value of this row? However, it is normal to remove the value printed by the hidden attribute. I don't understand the reason. Please explain it...

Reply content:

The Code is as follows:
Foreach ($ userinfo as $ key => $ value ){

   $user=(object)$value; 

}
?>

Why is the input value $ _ POST ['device _ id'] submitted to another page always the value in the first row of the table? The onclick event using tag a cannot pass the value of this row? However, it is normal to remove the value printed by the hidden attribute. I don't understand the reason. Please explain it...

Input is not specified name? How do you obtain data? Different forms depend on different nameAttribute.

 

Same name?

If the name of an http request is the same, the other one is removed .. At the same time, this question looks messy.

You have n forms. If you want to submit the form in the same form, first take the form out of the loop, and then the name can be obtained using aaaa []. The post is an array.

Supplement: the question is a bit messy, but the main reason is that the name is either set to different, or set to name [] to get the result as an array ..........

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.