title: Form submit 2 arrays
body: <p>I am trying to make a form submit.</p>
  
  <p>Form is select a task, then show several rows with checkbox and select with values 1-10 </p>
  
  <p>If checkbox is selected is need to add values from select into database.</p>
  
  <p>this is PHP code</p>
  
  <pre><code>if(isset($_POST) &amp;&amp; $_SERVER['REQUEST_METHOD'] = 'POST'){   
      if(isset($_POST['submita'])){
          foreach($_POST['nota'] as $key =&gt; $value)
              if (isset($_POST['boxes'])){
                  foreach($_POST['boxes'] as $key =&gt; $value2){
                      if(isset($value2)){
  
                          $nota = htmlent($_POST['nota']);
                          $box = htmlent($_POST['boxes']);
                          $task = htmlent($_POST['task']);
  
  
                          $db-&gt;insert(array(
                                      "task" =&gt; $task,
                                      "nota" =&gt; $value,
                                      "box" =&gt; $value2,
                                      ), 
                                  "erp_notes");  
                      }
                      else
                      {
                          echo 'Select';
                      }
                  }
  
              }
          }
      }
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;input type="checkbox" name="boxes[]" value="&lt;?=$row['id'];?&gt;"&gt;&lt;/input&gt;
  &lt;?=$row['name'];?&gt;
  &lt;select name="nota[]" &gt;
    &lt;option value=""&gt;Select&lt;/option&gt;
    &lt;option value="2"&gt;2&lt;/option&gt;
    &lt;option value="3"&gt;3&lt;/option&gt;
    &lt;option value="4"&gt;4&lt;/option&gt;
    &lt;option value="5"&gt;5&lt;/option&gt;
    &lt;option value="6"&gt;6&lt;/option&gt;
    &lt;option value="7"&gt;7&lt;/option&gt;
    &lt;option value="8"&gt;8&lt;/option&gt;
    &lt;option value="9"&gt;9&lt;/option&gt;
    &lt;option value="10"&gt;10&lt;/option&gt;
  
  &lt;/select&gt;
  </code></pre>
  
  <p>I try many time but nothing.</p>