droopz17 Posted November 21, 2007 Share Posted November 21, 2007 My site involves a header ( nav goes between header and middle ) middle ( main content goes between middle and footer ) and footer. exp: include('header.php') include('nav.php') include('middle.php') main content.php include('footer.php') well i want to have it so that when someone fills out a form wrong it submits an error message and displays it at the top of the main content using middle.php but i'll have the footer.php collect all the error messages which are being assigned to "$em.= 'my errors';" using a hidden field and using header to redirect back to the same page. If i have footer echo the em then the problem is that it shows all my content and then the error message at the bottom. So i was thinking i could have it take the $em variable and redirect to the same page using a hidden field so that it can be displayed in the middle.php which will show the errors messages on the top of all my content. here's how it goes header nav middle if error message then redirect along with hidden variable ($em) and diplay using middle else display form footer. so if you can see i have it displaying the form or the error and i think i just thought of how to fix it but i'm gonna leave this up still. I could do it as " echo 'my error message'; but i want it to be setup so that all my message look exactly the same and all i have to do is change the error message display in the middle.php if i want to change the format at all. Quote Link to comment Share on other sites More sharing options...
premiso Posted November 21, 2007 Share Posted November 21, 2007 www.php.net/session You want to use session's which will essentially hide the "Errors" Another alternative is to you AJAX and never really "Refresh" the page and just have the error check done on its own. Either way should give you your desired result. Quote Link to comment Share on other sites More sharing options...
droopz17 Posted November 21, 2007 Author Share Posted November 21, 2007 Sweet thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.