php variable persistance
- by Illes Peter
I have two files:
index.php
/lib/user.php
Index contains the form:
<div class="<? echo $msgclass; ?>">
<? echo $msg; ?>
</div>
<form id="signin" action="/lib/user.php" method="post">
...
</form>
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
But after redirection $msg and $msgalert no longer persist and index only gets empty vars.
How can i fix this?