title: Checking if radiobutton is checked using POST
body: <p>I'm trying to redirect the user to another webpage depending on which radio button they have checked.</p>
  
  <p>Here is the relevant code:</p>
  
  <pre><code>  &lt;form action="sample.php" method="post"&gt;
            &lt;input name="survey" type="radio" value="Yes" /&gt; Yes
            &lt;/br&gt;
            &lt;input name="survey" type="radio" value="No"  /&gt; No
    &lt;/form&gt;
  
    &lt;? 
      if ($_POST['survey'] == "Yes")
      {
          header('Location: http://localhost/survey.php');
      }
      else if ($_POST['survey'] == "No")
      {
          header('Location: http://localhost/survey.php');
      }
  
    ?&gt;
  </code></pre>
  
  <p>For some reason or another I get an error within my if statement. That does not recognize 'survey' as a valid index. How Am I failing to do something to link my form to the php code?</p>