johnsmith153 Posted July 20, 2010 Share Posted July 20, 2010 I know this is ultra basic but I am sure there is a better way than how I do it. I always submit the form to the same page: <?php $error = ""; if(isset($_POST['submit'])) { //check form if($formOK==1) { //add record and redirect } else { //allow page to continue so display form again $error = "Not completed"; } } echo $error; ?> <form> <input type="text" value="<?php echo $_POST['name']; ?>"> </form> ..so the above always shows the values entered in the form The problem is I get the web-page expired problem. If I header redirect after form submit (either another .php page or the same one) I then lose ability to display values submitted in $_POST. What do I do to get $_POST values but no web-page expired messages? Link to comment https://forums.phpfreaks.com/topic/208355-submitting-forms/ Share on other sites More sharing options...
waynew Posted July 20, 2010 Share Posted July 20, 2010 Where are you getting $formOK from? Link to comment https://forums.phpfreaks.com/topic/208355-submitting-forms/#findComment-1088862 Share on other sites More sharing options...
johnsmith153 Posted July 20, 2010 Author Share Posted July 20, 2010 I'm not, it's an example. It won't make a difference to my question anyway. Link to comment https://forums.phpfreaks.com/topic/208355-submitting-forms/#findComment-1088863 Share on other sites More sharing options...
johnsmith153 Posted July 21, 2010 Author Share Posted July 21, 2010 Does anybody know the answer? I'm sure I have explained it properly. Link to comment https://forums.phpfreaks.com/topic/208355-submitting-forms/#findComment-1088872 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.