title: Why is my php form not generating values?
body: <p>How do you create a form in PHP where the results entered in from the user will be generated in a table? When I test the pages, I only get the start of the table, key and results(values) fields but no values! </p>
  
  <p>Here is my code (I'm shortening the number of fields to two since forms can be very long:</p>
  
  <p>Order form:</p>
  
  <pre><code>&lt;?php
  
  foreach ($_POST as $key =&gt; $entry)
  {
      $totalfields++;
      echo "&lt;tr&gt;\n";  
  
      echo "&lt;td&gt;" . $key . "&lt;/td&gt;";
  
      if (is_array ($entry)) { 
          $count = count($entry);
          echo "&lt;td&gt;";
          for ($i=0; $i&lt;$count; $i++){
              echo $entry[$i] . "&lt;br /&gt;";
          }
          echo "&lt;/td&gt;";
      }   else   
      {
          echo "&lt;td&gt;$entry&lt;/td&gt;";
      }
      echo "&lt;tr&gt;\n";
  }
  ?&gt;
  
  &lt;form method="post" action="address to the results form page"&gt;  
  
  
  &lt;label for="fname"&gt;First Name:&lt;/label&gt;
  &lt;input type="text" name="fname" id="fname"/&gt;&lt;br/&gt;
  &lt;br/&gt;
  
  &lt;label for="lname"&gt;Last Name:&lt;/label&gt;
  &lt;input type="text" name="lname" id="lname"/&gt;&lt;br/&gt;
  &lt;br/&gt;
  
   &lt;p&gt;&lt;input type="submit" value="Submit"/&gt;&lt;/p&gt;
  
  
   &lt;/form&gt;
  </code></pre>
  
  <p>Results form page:</p>
  
  <pre><code> &lt;div id="results table"&gt;
   &lt;table border='1'&gt;
   &lt;tr&gt;
   &lt;th&gt;
    Field
   &lt;/th&gt;
   &lt;th&gt;
    Results
   &lt;/th&gt;
   &lt;/tr&gt;
   &lt;/table&gt;
   &lt;/div&gt;
  </code></pre>