php - Issue getting $_POST from multiple checkboxes -


i made form multiple checkboxes in it, follows:

<form action="" method="post">        <div class="row">         <div class="col-sm-9">             <div class="form-group">                 <label>choose rooms:</label>                 <ul id="scegli_camere">                     <li><input type="checkbox" name="rooms[]" value="101" > camera 101</li>                     <li><input type="checkbox" name="rooms[]" value="102" > camera 102</li>                 </ul>             </div>         </div>     </div><!-- /.row -->     <div class="row">         <div class="col-lg-6">                                       <button type="submit" class="btn btn-primary" id="btn_submit"><i class="fa fa-save"></i> modify</button>         </div>     </div> </form> 

after submission of form, if no 1 of checkbox checked empty array, while if 1 checked, post follows:

array(     [rooms] =>  ) 

why $_post['rooms'] empty?

i have checked code. working fine in environment , getting checked values.you can debug 2 things-

  1. wheather checkbox being checked or not while submitting form
  2. print_r($_post) print full post array.

hope work.


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -