title: HTML. How to pass check box value to php?
body: <p>I have form and here is check box, how to pass value from check box to PHP? For example.: If checkbox is checked  pass <code>1</code>, if not checked <code>0</code>.</p>
  
  <p>I'm using following:</p>
  
  <pre><code>&lt;input type="checkbox" name="letter" value="letter" id="letter" checked="checked"&gt;
  </code></pre>
  
  <p>This is my form:</p>
  
  <pre><code>  &lt;form class="form"  method="post" action="GetFbId.php"&gt;
      &lt;h2&gt;Registration&lt;/h2&gt;&lt;hr/&gt;
      &lt;label&gt;First Name: &lt;/label&gt;
      &lt;input type="text" name="first_name" id="first_name" required&gt;
  
      &lt;label&gt;Last Name: &lt;/label&gt;
      &lt;input type="text" name="last_name" id="last_name" required&gt;
  
      &lt;label&gt;City: &lt;/label&gt;
      &lt;input type="text" name="city" id="city" required&gt;
  
      &lt;label&gt;Email: &lt;/label&gt;
      &lt;input type="text" name="email" id="email" required&gt;&lt;br&gt;
  
      Accept to get letters 
      &lt;input type="checkbox" name="letter" value="letter" id="letter" checked="checked"&gt;
  
      &lt;input type="submit" name="register" id="register" value="Register"&gt;
    &lt;/form&gt;
  </code></pre>