title: set php radio button checked by default
body: <p>I have two radio buttons in my program but when i run it none of them is checked, I want one of them to be checked by default,
  how can i achieve this ?</p>
  
  <pre><code>&lt;li&gt;&lt;input type="radio" name="r1" value="o" onClick="submit();" &lt;?php echo ($_SESSION['r1'] == "o") ? 'checked="checked"' : ''; ?&gt; /&gt;On&lt;/li&gt;
  &lt;li&gt;&lt;input type="radio" name="r1" value="p" onClick="submit();" &lt;?php echo ($_SESSION['r1'] == "p") ? 'checked="checked"' : ''; ?&gt; /&gt;Off&lt;/li&gt;
  </code></pre>
  
  <p>I want the 'On' button to be checked when i open the page for the first time</p>