title: php variable persistance
body: <p>I have two files:</p>
  
  <p>index.php
  /lib/user.php</p>
  
  <p>Index contains the form:</p>
  
  <pre><code>&lt;div class="&lt;? echo $msgclass; ?&gt;"&gt;
    &lt;? echo $msg; ?&gt;
  &lt;/div&gt;
  &lt;form id="signin" action="/lib/user.php" method="post"&gt;
  ...
  &lt;/form&gt;
  </code></pre>
  
  <p>User.php makes all the processing.
  It sets $msg to 'some error message' and $msgalert to 'error' in case of any error. At the end of processing it uses header() to redirect to index.php</p>
  
  <p>But after redirection $msg and $msgalert no longer persist and index only gets empty vars.
  <strong>How can i fix this?</strong></p>