PHP is used to obtain the values of all the check boxes of a form. php is used to obtain the checkbox _ PHP Tutorial.

Source: Internet
Author: User
PHP is used to obtain the values of all the check boxes of a form. php is used to obtain the check boxes of a form. PHP is used to obtain the values of all the check boxes of a form. generally, php obtains only the values of the last check box, how can I get the values of all check boxes? PHP: how to get the values of all check boxes in a form. php: how to get the values of all check boxes in a form.

Generally, php always obtains only the value of the last check box. how can we get the value of all check boxes?

The solution is as follows:

Some code of form is as follows:

12345

The php code for processing POST-transmitted data is as follows:

$str_tag = "";$frm_tag = $_POST['frm_tag'];for($i=0;$i
 
  ";  if($i==0)   $str_tag = $frm_tag[$i];  else   $str_tag = $str_tag.",".$frm_tag[$i];}echo $str_tag;}
 

I believe this article provides some reference value for you to have a deep understanding of PHP programming.


How to obtain check box data for PHP form problems

Yes. If no selection is made, the checkbox in the form will not be submitted.
So the prompt is displayed.
==========
You can judge and output again.
If (isset ($ _ POST ["orange"]) echo $ _ POST ["orange"];

How can I post a php form to get the checkbox value and put it into the database?

Wow, I just did this. checkbox is an array. you need to put them in the array.
The principle is: pass those values. Convert them into non-arrays.
For example:
29
30
31
32
These forms
$ Waistline = $ _ POST ["waistline"];
$ Myallsport = implode (",", $ waistline );

In this way, $ myallsport will be inserted into the insert file.
 

In general, php always obtains only the value of the last check box. how can we get the value of all check boxes...

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.