title: insert span values in database with PHP Prepared Statements
body: <p>I have a contact form where I have some checkboxes. After the user submits the form I want to get their entries in the database. I can do this properly, but today I wanted to change my form to be responsive. I changed my simple checkboxes to span tags, but now I can not get the values in the database. It did not give me any error but also did not show anything in the database.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
    &lt;body&gt;
      &lt;form action="" method="POST" &gt;
  &lt;section&gt;
    &lt;div class="wrapper-checkbox"&gt;
  
      &lt;div class="checkbox"&gt;
        &lt;div class="text"&gt;
          &lt;span name="check1" value="rent"&gt;rent&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="checkbox"&gt;
        &lt;div class="text"&gt; 
          &lt;span   name="check2" value="buy"&gt;buy&lt;/span&gt;
        
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/section&gt;
      &lt;script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'&gt;&lt;/script&gt;
  &lt;script src="js-checkbox/index.js"&gt;&lt;/script&gt;
        &lt;/form&gt;
  
  &lt;?php
  $check1 = !empty($_POST['check1']) ? $_POST['check1'] : '';
  $check2 = !empty($_POST['check2']) ? $_POST['check2'] : '';
  if ($stmt = mysqli_prepare($connect, "INSERT INTO $db_table VALUES (?, ?)"))
  {
  mysqli_stmt_bind_param($stmt, "ss",$check1,$check2);
  ?&gt;
     &lt;/body&gt;
   &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>