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...