dimanche 25 novembre 2018

Getting error while submitting the multiple checkbox value using codeigniter

I am getting some error while submit the form having multiple checkbox value using code-igniter. I am explaining my code below.

filter.php:

<form class="listing_filter"  action="<?php echo $baseUrl;?>search" method="GET" style="background:#f2f2f2;">
foreach($moduleTypes as $mtype){
   if(!empty($mtype->name)){
      <div class="go-right">
         <div class="checkboxTypeRadioUI">
         <input type="checkbox" value="<?php echo $mtype->id;?>" name="type[]" id="<?php echo $mtype->name;?>" class="checkbox filled-in go-right" <?php if($mtype->id == $vartype){echo "checked";}?> /><label for="<?php echo $mtype->name;?>" class="css-label go-left"> &nbsp;&nbsp; <?php echo $mtype->name;?> &nbsp;&nbsp;</label>
     </div>
       </div>
     <div class="clearfix"></div>
   }
}
<button style="border-radius:0px;margin-bottom:0px;" type="submit" class="btn btn-action btn-lg btn-block loader" id="searchform">Search</button>

</form>

My controller side code is given below.

Tour.php:

function search($country = null, $city = null, $citycode = null,$offset = null) {
  $type = $this->input->get('type');
  print_r( $type);exit;
}

Here when I am clicking on search button 500 Internal Server Error is coming . Here I need to get the multiple checkbox values.




Aucun commentaire:

Enregistrer un commentaire