title: Using hidden input to preserve form contents
body: <p>I am currently working on a small signup sheet for a bigger project which will integrate it, and I'm trying to figure out how to integrate a hidden form field(s) into it, to preserve data across submissions. Basically, whenever someone signs up on the form, their name should appear next to the entry, and that entry should not change when the next person submits the form (i.e., it shouldn't become available again). This is what I am working with so far:</p>
  
  <pre><code>    Name: &lt;input type="text" name="name"&gt;&lt;br&gt;
      Select from one of the following:&lt;br&gt;
      &lt;fieldgroup&gt;
          &lt;?php
  
              $form_contents = "";
  
              if (isset($_POST['food']) &amp;&amp; $_POST['food'] == 'pasta') {
                  $form_contents .= "&lt;input type='hidden'&gt;Pasta - " . $_POST['name'] . "&lt;br&gt;";
              } else {
                  $form_contents .= '&lt;input type="radio" name="food" value="pasta"&gt;Pasta&lt;/input&gt;&lt;br&gt;';
              }
  
              if (isset($_POST['food']) &amp;&amp; $_POST['food'] == 'salad') {
                  $form_contents .= "Salad - " . $_POST['name'] . "&lt;br&gt;";
              } else {
                  $form_contents .= '&lt;input type="radio" name="food" value="salad"&gt;Salad&lt;/input&gt;&lt;br&gt;';
              }
  
              if (isset($_POST['food']) &amp;&amp; $_POST['food'] == 'burgers') {
                  $form_contents .= "Burgers - " . $_POST['name'] . "&lt;br&gt;";
              } else {
                  $form_contents .= '&lt;input type="radio" name="food" value="burgers"&gt;Burgers&lt;/input&gt;&lt;br&gt;';
              }
  
              echo $form_contents;
          ?&gt;
      &lt;/fieldgroup&gt;
  </code></pre>
  
  <p>Currently, this form stores an initial entry, but the next time I submit it, that name is erased and the selection becomes available again. Is there any way to keep that entry so that it is preserved every time the form is submitted? Any help is appreciated!</p>