title: if checkbox is checked change the value using PHP
body: <p>I'm trying to accomplish one simple task (but is not simple for me).</p>
  
  <p>I have a form and I'm having a trouble with this check box.</p>
  
  <pre><code>    &lt;input type="checkbox" name="b"  
  &lt;?php if (isset($_POST[b])) echo "value='y'"; else echo "value='n'"; ?&gt;/&gt;
  </code></pre>
  
  <p>I'm not sure if I use the right one, but it doesn't work for me.</p>
  
  <p>So basically I want the value of the <code>input</code> of <code>b</code> will be <code>y</code> if the checkbox is checked else it will always be <code>n</code> if the checkbox is unchecked.</p>