|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
form to form to form submit
how can i take form data posted to a form from another form and then forward it to another form without having a submit button on the intermediate page. Any help woud be deeply appreciated.
|
|
#2
|
|||
|
|||
|
RE: form to form to form submit
How is the intermediate page sending the user to the third or whatever page? Do they click on a link, it is redirected, etc..
- CBronson |
|
#3
|
|||
|
|||
|
RE: form to form to form submit
Thats just it, there is to be no link cliking or anything. just a decision made and then a done to the new page.
|
|
#4
|
|||
|
|||
|
RE: form to form to form submit
Well, depending on what your doing with that intermediate page, I'd rethink the way your structuring your program, however if your just looking for the lazy way out. For an easy example, I'll just pull the verbage out of this book next to me on that I think would help you the best.
-------SNIP FROM PHP4 BIBLE--------- One usefull kind of HTTP header is "Location:", which can act as a redirector. Simply put a fully qualified URL after the "Location:" string, and the browser will start over again with the new address instead. An example: <?php if ((IsSet($gener) && ($gener == "female")) { header("Location: http://somewhere.com/yourmother.php"); exit; } ?> <html><head><title>blah</title></head> <body> FEMALES ONLY! =P </body> </html> If we simply enter the url for this page we will see the rendering of the html "FEMALES ONLY!" On the other hand, if we include the right GET (or POST for that matter) we will find ourselves redirect to the yourmother.html page. And in your particular case, just add the correct variables that you want to after the yourmother.html?variable1=this I'm sure this can be done somehow with a POST, but just like you... I'm to lazy to look through this book! =) - CBronson |
|
#5
|
|||
|
|||
|
RE: form to form to form submit
i had a similar situation, although, i couldnt figure out how to do it, so what i did, was have a 'next page' button at the bottom of each page, and then above the html of the next form, insert the data from the form previous and so on....
|
|
#6
|
|||
|
|||
|
RE: form to form to form submit
I actually just made an application that does something similar to what you just wrote about.
It's a multi-page 'wizard' that walks users through a process. Each page is submitted (via next/previous for example) to a validation page, that ensures the data just entered is correct. And if the data is correct the user is forwarded via the header() function to the next/previous page as appropriate. If the data is not correct, the user is sent back (via header() ) to the same page they just came from, along with an error message dialogue explaining what needs to be corrected to continue. [edited to add]: I forgot to tell you how I passed the info from validation back to the pages I use the $_SESSION variable to pass the values. Alternatively you can used <input type="hidden"> in the form itself. You would just need to add logic to make sure that you don't write the hidden fields out for a page if you are on that page. i.e. a three page wizard. The user can navigate backwards and forward through the wizard. So, if the user goes to page 1 enters data, and then clicks next, on page two you would have all the entry fields for page 2 and hidden fields for page 1. If the user now goes back to page 1 to change a piece of data, you display all the entry fields with the old data they entered, and have the page 2 data as hidden fields...etc. You could also store each page of data entered in a database, and then pull each page out of the db to display it as the user navigates back and forth. [end edit] Cheers, Keith. |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > form to form to form submit |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|