title: php- dynamically created radio buttons handle
body: <p>so.. i've got an upload page where i can upload an xml table filled with data. im handling it on the page itself (not sending it to any db- after the page is closed its erased)
  i dont know how many rows will be uploaded everytime but its not suppose to be larger than 100.</p>
  
  <p>now, i got this part, as a form that gets all of the data uploaded and the user needs to pick a value in the radio button created for every row (value of radio buttons: 1-5):</p>
  
  <pre><code>&lt;form enctype="multipart/form-data" name="myForm" method="post" action="&lt;?php echo $_SERVER['PHP_SELF']?&gt;" onsubmit="return checkForm()"&gt;
      &lt;?php $numRow=0;?&gt;
      &lt;?php //echo "&lt;input type='radio' name='difficulty".$numRow."' value='11'&gt;11";?&gt;
      &lt;table border="1"&gt;
          &lt;tr&gt; 
              &lt;th&gt;table of all courses&lt;/th&gt; 
          &lt;/tr&gt; 
          &lt;?php $data[0]['Points']="נז";?&gt;
          &lt;?php foreach( $data as $row ) { ?&gt; 
          &lt;tr&gt; 
              &lt;td&gt;&lt;?php echo( $row['Year'] ); ?&gt;&lt;/td&gt;
              &lt;td&gt;&lt;?php echo( $row['Semester'] ); ?&gt;&lt;/td&gt;
              &lt;td&gt;&lt;?php echo( $row['Code'] ); ?&gt;&lt;/td&gt;   
              &lt;td&gt;&lt;?php echo( $row['Course'] ); ?&gt;&lt;/td&gt; 
              &lt;td&gt;&lt;?php echo( $row['Points'] ); ?&gt;&lt;/td&gt; 
              &lt;td&gt;&lt;?php echo( $row['Grade'] ); ?&gt;&lt;/td&gt;
              &lt;td&gt;&lt;?php if ($numRow &gt; 0)
                      {
                          for($choise=1;  $choise&lt;6;  $choise++)
                          {
                              echo "&lt;input type='radio' name='difficulty".$numRow."' value='".$choise."'&gt;".$choise."&amp;nbsp;&amp;nbsp;&amp;nbsp;";
                          }
                      }
                  ?&gt;
              &lt;/td&gt;
          &lt;/tr&gt; 
          &lt;?php $numRow++;                }$numRow--; ?&gt; 
      &lt;/table&gt; 
      &lt;input name="next" type="submit" value="continue" onclick="return true;"&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>it works good and for every gets diffrent value for radio buttons on each row good, but the problem is, how do i handle it?
  i was thinking about maybe sending all of the picked raio buttons values to an array?</p>
  
  <p>i also got in the same page this part, for after the user picked all:</p>
  
  <pre><code>&lt;?php 
  
      if(isset($_POST['next']) ) 
      { 
          if(isset($_POST['difficulty2']))
              $difficulty2 = $_POST['difficulty2'];
                      else
              $difficulty2="";
          if(isset($_POST['difficulty1']))
              $difficulty1 = $_POST['difficulty1'];
          else
              $difficulty1="";
          echo "User Has submitted the form and entered this difficulty1 : &lt;b&gt; $difficulty1 &lt;/b&gt;&lt;/br&gt;";
          echo "User Has submitted the form and entered this difficulty2 : &lt;b&gt; $difficulty2 &lt;/b&gt;&lt;/br&gt;";           
      }
  
      else
      {
  ?&gt;
  </code></pre>
  
  <p>i can get the values like that,  but is there a cleaner, faster way than just checking how many rows are there and looping for adding all POST in an array?
  i hope i made myself clear and thanks for the help :P</p>