title: php get the value from hidden field after redirect
body: <ul>
  <li><p>member.php</p>
  
  <pre><code>&lt;?php
      if(isset($_POST['submit']))
      {
          $membername = $_POST['membername'];
  
          if(empty($membername))
          {
              $errors .= "Please enter member name&lt;br /&gt;";
          }
  
          if($errors)
          {
              $action = $_POST['submit'];
              echo $errors;
              displayForm();
          }
          else
          {
  ?&gt;
              &lt;input type="hidden" name="mname" value="&lt;?php echo $_POST['membername']; ?&gt;" /&gt;
  &lt;?php
              $action = $_POST['submit'];
              header("Location: commit.php?action=$action");
              exit();
          }
      }
      else
      {
          displayForm();
      }
  ?&gt;
  
  &lt;?php
  function displayForm()
  {
  ?&gt;
      &lt;form action = "member.php" action="post"&gt;
          Member Name &lt;input type="text" name="membername" value="&lt;?php if(isset($row['name'])) echo $row['name']; 
          else echo ''; ?&gt;" /&gt;&lt;br /&gt;&lt;input type="text" name="membername" value=
          &lt;input type="submit" name="submit" name="add" /&gt;
      &lt;/form&gt;
  &lt;?php
  }
  ?&gt;
  </code></pre></li>
  <li><p>Commit.php</p>
  
  <pre><code>&lt;?php
      echo $_POST['mname']; //HERE
  ?&gt;
  </code></pre></li>
  <li><p>I want to pass the hidden value from member.php. When I run commmit.php, I want to get hidden field value. However, the error is the following:
  **Undefined index: mname in member.php in commit.php. </p></li>
  <li>What am I doing wrong?</li>
  </ul>