title: Checkbox ajax form posts the word array to email
body: <p>I am trying to make a booking form with checkboxes using an existing contact form.js script and mailhandler.php from template monster. All of the text and textarea inputs work fine but the checkboxes only return the word array.</p>
  <p>Here's parts of the code:</p>
  <p>html</p>
  <pre><code>     &lt;form action=&quot;bin/MailHandler.php&quot; method=&quot;post&quot; id=&quot;booking-form&quot; &gt;
          &lt;fieldset&gt;
          &lt;div class=&quot;grid_12&quot;&gt;
          &lt;div class=&quot;bookingformwrapper&quot;&gt;
            &lt;div class=&quot;headerbar&quot;&gt;WAXING&lt;/div&gt;
            
                  intrested in:&lt;br/&gt;
              &lt;input type=&quot;checkbox&quot; name=&quot;waxing[]&quot; value=&quot;kidum_esek&quot; id=&quot;wax1&quot;/&gt;aaa&lt;br /&gt;
              &lt;input type=&quot;checkbox&quot; name=&quot;waxing[]&quot; value=&quot;mitug_esek&quot; id=&quot;wax2&quot;/&gt;bbb&lt;br /&gt;
              &lt;input type=&quot;checkbox&quot; name=&quot;waxing[]&quot; value=&quot;laikim&quot; id=&quot;wax3&quot;/&gt;CCC&lt;br /&gt;
              &lt;input type=&quot;checkbox&quot; name=&quot;waxing[]&quot; value=&quot;aher&quot; id=&quot;wax4&quot;/&gt;DDD&lt;br /&gt;
  </code></pre>
  <p>ajax jquery</p>
  <pre><code>    ,submitFu:function(){
  
  var data = { 'waxing[]' : []};
  $(&quot;:checked&quot;).each(function() {
    data['waxing[]'].push($(this).val());
     });
  
                          _.validateFu(_.labels)                          
                          if(!_.form.has('.'+_.invalidCl).length)
                                              
                              $.ajax({
                                  type: &quot;POST&quot;,
                                  url:_.mailHandlerURL,
                                  data:{
                                      choice:'waxing[]',
                                      name:_.getValFromLabel($('.name',_.form)),
                                      email:_.getValFromLabel($('.email',_.form)),
                                      phone:_.getValFromLabel($('.phone',_.form)),
                                      fax:_.getValFromLabel($('.fax',_.form)),
                                      state:_.getValFromLabel($('.state',_.form)),
                                      message:_.getValFromLabel($('.message',_.form)),
                                      message2:_.getValFromLabel($('.message2',_.form)),
                                      datepicker:_.getValFromLabel($('#datepicker',_.form)),
                                      owner_email:_.ownerEmail,
                                      stripHTML:_.stripHTML
                                  },
                                  success: function(){
                                      _.showFu()
                                  }
                              })          
                      },
  </code></pre>
  <p>php</p>
  <pre><code>    &lt;?php
  $owner_email = $_POST[&quot;owner_email&quot;];
  $headers = 'From:' . $_POST[&quot;email&quot;];
  $subject = 'A message from your site visitor ' . $_POST[&quot;name&quot;];    
  $messageBody = &quot;&quot;;
  
  if($POST['waxing[]'] !='nope'){
      $messageBody .= '&lt;p&gt;Choice: ' . explode(&quot;,&quot;, $_POST['waxing[]']);
      $messageBody .= '&lt;br&gt;' . &quot;\n&quot;;
  }
  
  if($_POST['name']!='nope'){
      $messageBody .= '&lt;p&gt;Visitor: ' . $_POST[&quot;name&quot;] . '&lt;/p&gt;' . &quot;\n&quot;;
      $messageBody .= '&lt;br&gt;' . &quot;\n&quot;;
  }
  if($_POST['email']!='nope'){
      $messageBody .= '&lt;p&gt;Email Address: ' . $_POST['email'] . '&lt;/p&gt;' . &quot;\n&quot;;
      $messageBody .= '&lt;br&gt;' . &quot;\n&quot;;
  }else{
      $headers = '';
  }
  if($_POST['state']!='nope'){        
      $messageBody .= '&lt;p&gt;State: ' . $_POST['state'] . '&lt;/p&gt;' . &quot;\n&quot;;
      $messageBody .= '&lt;br&gt;' . &quot;\n&quot;;
  }
  if($_POST['phone']!='nope'){        
      $messageBody .= '&lt;p&gt;Phone Number: ' . $_POST['phone'] . '&lt;/p&gt;' . &quot;\n&quot;;
      $messageBody .= '&lt;br&gt;' . &quot;\n&quot;;
  }   
  if($_POST['fax']!='nope'){      
      $messageBody .= '&lt;p&gt;Fax Number: ' . $_POST['fax'] . '&lt;/p&gt;' . &quot;\n&quot;;
      $messageBody .= '&lt;br&gt;' . &quot;\n&quot;;
  }
  if($_POST['datepicker']!='nope'){
      $messageBody .= '&lt;p&gt;Date: ' . $_POST['datepicker'] . '&lt;/p&gt;' . &quot;\n&quot;;
      $messageBody .= '&lt;br&gt;' . &quot;\n&quot;;
  }
  if($_POST['message']!='nope'){
      $messageBody .= '&lt;p&gt;Address: ' . $_POST['message'] . '&lt;/p&gt;' . &quot;\n&quot;;
  }
  if($_POST['message2']!='nope'){
      $messageBody .= '&lt;p&gt;Notes: ' . $_POST['message2'] . '&lt;/p&gt;' . &quot;\n&quot;;
  }
  if($_POST[&quot;stripHTML&quot;] == 'true'){
      $messageBody = strip_tags($messageBody);
  }
  
  try{
      if(!mail($owner_email, $subject, $messageBody, $headers)){
          throw new Exception('mail failed');
      }else{
          echo 'mail sent';
      }
  }catch(Exception $e){
      echo $e-&gt;getMessage() .&quot;\n&quot;;
  }
  
  ?&gt;
  </code></pre>
  <p>This is what gets returned on the email:</p>
  <pre><code>Choice: Array
  Visitor: Father Christmas
   
  Email Address: father@christmas.com
   
  Phone Number: 01234 567890
   
  Date: 25th December
   
  Address: North Pole
  
  Notes: Mince Pies
  </code></pre>
  <p>Where it says Choice: Array, I need it to give me the values of the selected/checked checkboxes.</p>