Jump to content

Archived

This topic is now archived and is closed to further replies.

just-j

how do i redirect back a page with $_POST vars??

Recommended Posts

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??

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
im sorry that i dont know the exact methods, but you need to use the header function

first defining the cache-control to allow for the form data to keep the form populated

then 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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.