just-j Posted July 18, 2006 Share Posted July 18, 2006 ok when someone submits a form then it goes to the .php page and checks the information they submited.. so if some info is wrong i.e, the password and retyped password dont match, then i want to go back to the form page and send some post vars and stop the php page from doing any more. how do i do this?? Quote Link to comment https://forums.phpfreaks.com/topic/14906-how-do-i-redirect-back-a-page-with-_post-vars/ Share on other sites More sharing options...
scott212 Posted July 18, 2006 Share Posted July 18, 2006 I'm not sure what others will say, but I approach that situation a little differently. I do the majority of my form processing for a page at the top of that page inside of an 'if' statement to see if the button name is valid (i.e. if the form was submitted). During the form processing at the top of the page, should the script fail a conditional, you just exit out and it continues on with the page. It also makes it really easy to pass feedback to the rest of the page about what went wrong. Cheers! Quote Link to comment https://forums.phpfreaks.com/topic/14906-how-do-i-redirect-back-a-page-with-_post-vars/#findComment-59765 Share on other sites More sharing options...
emehrkay Posted July 18, 2006 Share Posted July 18, 2006 im sorry that i dont know the exact methods, but you need to use the header functionfirst defining the cache-control to allow for the form data to keep the form populatedthen in your processing php page, before anything is outputted to the browser, you check to see if the passwords match. if they dont you do a header("location: ") call Quote Link to comment https://forums.phpfreaks.com/topic/14906-how-do-i-redirect-back-a-page-with-_post-vars/#findComment-59783 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.