title: Keep form input field value when reloading page in PHP
body: <p>I have a webpage with a form on it.</p>
  
  <p>I use this php code to put the value of the form in sessions when de _POST method is activated:</p>
  
  <pre><code>&lt;?php session_start(); ?&gt;
  &lt;?php
  $dump ='';
  $dump .='&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;&lt;/head&gt;
      &lt;body&gt;';
  
  
  $dump .='   
      &lt;h1&gt;Deel 1: registratiegegevens&lt;/h1&gt;
  &lt;form action="oplossing21-deel2.php" method="post"&gt;
  
  &lt;ul&gt;
          &lt;li&gt;            &lt;label for="email"&gt;email: &lt;/label&gt;&lt;input type="text" name="email" id="email" value="'.$email.'" /&gt;
          &lt;/li&gt;
                      &lt;br /&gt;
          &lt;li&gt;            &lt;label for="nickname"&gt;nickname: &lt;/label&gt;&lt;input type="text" name="nickname" id="nickname" /&gt;
          &lt;/li&gt;
                      &lt;br /&gt;
          &lt;li&gt;            &lt;input type="submit" value ="volgende" /&gt;
          &lt;/li&gt;
  
  
  &lt;/ul&gt;
                  &lt;/form&gt;
  
  ';  
  
  
  
  
  if ($_POST) {
    // Store our name in the session array
    $_SESSION["email"] = $_POST["email"];
    $_SESSION["nickname"] = $_POST["nickname"];
  }
  
  $email = isset($_SESSION["email"]) ? $_SESSION["email"] : "leeg";
  
  
  
  
      $dump .='   
  
      &lt;/body&gt;
  &lt;/html&gt;';
  echo $dump;
  
  ?&gt;    
  </code></pre>
  
  <p>Now i want to know how i can make sure that if i reload the page (F5 or cmd+r), that the fields are filled in with the last typed values. So i submit the form, and i go to the next page, but when i come back, i want the input fields to be filled in with the last known value. Can someone help me with this? I already tried to do something with the isset() - function but i don't know where to go from here.</p>
  
  <p>on the second page i just put the sessions on the html file, and that works..</p>
  
  <pre><code>&lt;li&gt;'.$_POST["email"].'&lt;/li&gt; 
  </code></pre>