title: include php file based on which radio button is selected
body: <p>I have a php file and I am trying to include another php file in it (for a dropdown) based on what is selected in the radio button but somehow it is not happenning.</p>
  
  <p>To test my work I created a scenario in jsfiddle but there too its not working (i think in jsfiddle i am not loading necessary things which i dont know how to load - please help how to load it in jsfiddle <a href="https://jsfiddle.net/7gb4etbw/" rel="nofollow">https://jsfiddle.net/7gb4etbw/</a>)</p>
  
  <p>Also need help in javascript function to achieve the above. Appreciate if someone can help me with this. Thank you.</p>
  
  <p>if male is selected, m_ext.php should get included else if female is selected, f_ext.php file should get selected</p>
  
  <pre><code>&lt;?php
  if(isset($_POST['submit']))
  {
      $gender=$_POST['gender'];
      $_SESSION['gender']=$gender;
      echo "&lt;script language='javascript'&gt;window.location='nextpage.php';&lt;/script&gt;";
  }
  ?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
      &lt;head&gt;
      &lt;title&gt;&lt;?php echo $info['title']; ?&gt;&lt;/title&gt;
      &lt;link href="css/layout.css" rel="stylesheet" type="text/css" /&gt;
      &lt;script src="js/jquery-1.11.2.min.js"&gt;&lt;/script&gt;
      &lt;style type="text/css"&gt;
          .red_color {
          color: #F00;
      }
      &lt;/style&gt;
  &lt;script language='javascript'&gt;
  func()
  {
  
      // I am struggling here
  
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form action="" method="post" name="Form1"&gt;
      &lt;table width="100%" border="0" cellpadding="5" cellspacing="5"&gt;
          &lt;tr&gt;
              &lt;td &gt;
                  &lt;div align="left"&gt;&lt;span class="red_color"&gt;*&lt;/span&gt; 
                      Gender
                  &lt;/div&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;div align="left"&gt;
                      &lt;input id="m" onclick="func()" name="mgender" value="Male" type="radio"  /&gt;
                      Male
                      &lt;input id="f" onclick="func()" name="fgender" value="Female" type="radio" /&gt;
                      Female
                  &lt;/div&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td &gt;
                  &lt;div align="left"&gt;&lt;span class="red_color"&gt;*&lt;/span&gt;
                      Message
                  &lt;/div&gt; 
              &lt;/td&gt;
              &lt;td &gt;
                  &lt;div align="left"&gt;
                      &lt;select name="txtname" id="txtid""&gt;
                          &lt;option value="" selected="selected"&gt;-Select-&lt;/option&gt;
                          &lt;?php include("m_ext.php"); ?&gt;
                      &lt;/select&gt;
                  &lt;/div&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>