title: How come checkbox state is not always passed along to PHP script?
body: <p>I have an HTML form:</p>
  
  <pre><code>&lt;form action='process.php' method='post'&gt;
    &lt;input type='checkbox' name='check_box_1' /&gt; Check me!&lt;br&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Here is a section from the PHP script <code>process.php</code>:</p>
  
  <pre><code>echo (isset($_POST['check_box_1']))?'Set':'Not set';
  </code></pre>
  
  <p>The output of the script when the checkbox is set is</p>
  
  <blockquote>
    <p>Set</p>
  </blockquote>
  
  <p>But when the checkbox is not set, the output is:</p>
  
  <blockquote>
    <p>Not set</p>
  </blockquote>
  
  <p>Why is this? This seems like a very poor design because my PHP script checks a number of <code>$_POST</code> variables to make sure they were passed along to the script. When the <code>$_POST['check_box_1']</code> value is not set, then how do I know whether the script failed to pass along the value or the checkbox was just not set?</p>