php variable persistance

Posted by Illes Peter on Stack Overflow See other posts from Stack Overflow or by Illes Peter
Published on 2010-04-22T16:08:34Z Indexed on 2010/04/22 16:23 UTC
Read the original article Hit count: 178

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about php

Related posts about session