Jump to content

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


just-j

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.