title: PHP Using value of radio button
body: <p>I'm trying to create a registration page where one person can register him/herself along with several other people or just register other people <strong>NOT</strong> including him/herself. So i've created 2 radio buttons for those options but i need to use the value of the radio button they select to display specific data. This is my code so far</p>
  
  <pre><code>&lt;form name="selectnum" action="&lt;?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?&gt;" method="post" &gt;
  &lt;input type="radio" name="people" value="1"/&gt; I'm attending &lt;br/&gt;
  &lt;input type="radio" name="people" value="2"/&gt; I'm not attending &lt;br/&gt;
  &lt;/form&gt;
  
  &lt;?php if($_POST["people"]==1) { ?&gt;
      How many, counting yourself, are you registering:
      &lt;select name="num_a"&gt;
      &lt;option value="1"&gt;1&lt;/option&gt;
      &lt;option value="2"&gt;2&lt;/option&gt;
      &lt;option value="3"&gt;3&lt;/option&gt;
      &lt;option value="4"&gt;4&lt;/option&gt;
      &lt;option value="5"&gt;5&lt;/option&gt;
      &lt;option value="6"&gt;6&lt;/option&gt;
      &lt;option value="7"&gt;7&lt;/option&gt;
      &lt;option value="8"&gt;8&lt;/option&gt;
      &lt;option value="9"&gt;9&lt;/option&gt;
      &lt;option value="10"&gt;10&lt;/option&gt;
      &lt;option value="11"&gt;11&lt;/option&gt;
      &lt;option value="12"&gt;12&lt;/option&gt;
      &lt;option value="13"&gt;13&lt;/option&gt;
      &lt;option value="14"&gt;14&lt;/option&gt;
      &lt;option value="15"&gt;15&lt;/option&gt;
      &lt;option value="16"&gt;16&lt;/option&gt;
      &lt;option value="17"&gt;17&lt;/option&gt;
      &lt;option value="18"&gt;18&lt;/option&gt;
      &lt;option value="19"&gt;19&lt;/option&gt;
      &lt;option value="20"&gt;20&lt;/option&gt;
      &lt;/select&gt;
  &lt;?php } elseif($_POST["people"]==2) { ?&gt;
      How many, NOT counting yourself, are you registering:
      &lt;select name="num_a"&gt;
      &lt;option value="1"&gt;1&lt;/option&gt;
      &lt;option value="2"&gt;2&lt;/option&gt;
      &lt;option value="3"&gt;3&lt;/option&gt;
      &lt;option value="4"&gt;4&lt;/option&gt;
      &lt;option value="5"&gt;5&lt;/option&gt;
      &lt;option value="6"&gt;6&lt;/option&gt;
      &lt;option value="7"&gt;7&lt;/option&gt;
      &lt;option value="8"&gt;8&lt;/option&gt;
      &lt;option value="9"&gt;9&lt;/option&gt;
      &lt;option value="10"&gt;10&lt;/option&gt;
      &lt;option value="11"&gt;11&lt;/option&gt;
      &lt;option value="12"&gt;12&lt;/option&gt;
      &lt;option value="13"&gt;13&lt;/option&gt;
      &lt;option value="14"&gt;14&lt;/option&gt;
      &lt;option value="15"&gt;15&lt;/option&gt;
      &lt;option value="16"&gt;16&lt;/option&gt;
      &lt;option value="17"&gt;17&lt;/option&gt;
      &lt;option value="18"&gt;18&lt;/option&gt;
      &lt;option value="19"&gt;19&lt;/option&gt;
      &lt;option value="20"&gt;20&lt;/option&gt;
      &lt;/select&gt;
  &lt;?php } ?&gt;
  </code></pre>
  
  <p>But I realized that there needs to be a submit button for the values of the radios buttons to get saved in the $_POST array. So instead of using the post data, how do I check to see which radio button the user has selected and display the appropriate question after? Thank you</p>