title: Form data not staying consistent, resetting after submit
body: <p>This is hard to explain so bear with me.</p>
  
  <p>I'm building a page that consists of multiple forms that are all submitted with one submit button at the bottom like so:</p>
  
  <pre><code>&lt;form action="" method="post"&gt;
  &lt;input type="text" name="name1" value="&lt;?$variable1;?&gt;" placeholder="Type here..."&gt;
  
  &lt;form action="" method="post"&gt;
  &lt;input type="text" name="name2" value="&lt;?$variable2;?&gt;" placeholder="Type here..."&gt;
  
  &lt;form action="" method="post"&gt;
  &lt;input type="text" name="name3" value="&lt;?$variable3;?&gt;" placeholder="Type here..."&gt;
  
  &lt;form action="" method="post"&gt;
  &lt;input type="text" name="name4" value="&lt;?$variable4;?&gt;" placeholder="Type here..."&gt;
  &lt;input type="submit" name="submit" value="Submit"&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>Each of these forms asks the user for data, which then echos to a text box so that they can copy/paste the output.</p>
  
  <p>Now, suppose the user fills out the data for one of these forms only and clicks on the submit button. Naturally, the data they entered would go to the text box. What I need however is that when the user then decides to fill out the rest of the forms, the data that was originally echoed is still in the text box, preferrably as well as the answer they put in the form (however not essential).</p>
  
  <p>What I'm finding at the moment is that the form resets after clicking submit, so even though the user has submitted one part of the form, when they go to fill out the rest and click submit again, only the other 3 are echoed and the first one is omitted.</p>
  
  <p>I hope this makes sense. Any idea on how one would go about this?</p>
  
  <p>EDIT: Nearly got it with the following:</p>
  
  <pre><code>if (isset($_POST['submit'])) {
  
  if (isset($_SESSION['test1'])) {
  $_SESSION['test1']=$_SESSION['test1'];
  }
  else {
  $_SESSION['test1'] = $_POST['test1'];
  }
  }
  </code></pre>
  
  <p>However the variable now doesn't change when we enter something new into the form field...</p>