title: Using the radio button 'checked' value in HTML and PHP
body: <p>So, I have a questions regarding the input type radio in HTML. As you know, you can put <code>checked</code> as a value, this will mark it as checked.</p>
  
  <p>The story is I am getting a 0 or 1 value from my database. I am then checking if it's 0 or 1 and will then mark one of the radio button's as checked.</p>
  
  <p>My code is as follows:</p>
  
  <pre><code>&lt;?php if($pay_op == 0) { ?&gt;
  
  &lt;input type="radio" value="paypal" id="pay_op" checked&gt;PayPal&lt;br /&gt;
  &lt;input type="radio" value="other" id="other_op"&gt;Other&lt;br/&gt;
  &lt;input type="submit" id="pay_op_submit" /&gt;
  
  &lt;?php } elseif ($pay_op == 1) { ?&gt;
  
  &lt;input type="radio" value="paypal" id="pay_op"&gt;PayPal&lt;br /&gt;
  &lt;input type="radio" value="other" id="other_op" checked&gt;Other&lt;br/&gt;
  &lt;input type="submit" id="pay_op_submit" /&gt;
  &lt;?php } ?&gt;
  </code></pre>
  
  <p>My problem now is, whenever I try to mark the other radio button as checked by clicking on it, both radio buttons are checked?</p>
  
  <p>I thought that this might have something to do with me checking if the value returned from the database is 0 or 1 and it will keep one of the radio buttons checked until that value is changed. Now my question is, does anyone know a solution to this issue so that whenever someone clicks on something different than the default checked radio button it will actually check that one and not both of them?</p>
  
  <p>Any tips are highly appreciated! =)</p>
  
  <p>Thanks!</p>