Venus wrote:
Hi all,
Newbie here!!
Welcome! enjoy :)
I have 4 forms(A,B,C,D) and a thank you page for my questionnaire.
People will be redirected to B or C depending on the last question's
answer. B or C will redirect to D after B or C is finished. D then
goes to the thank you page.
I want to get all the answers from A,B/C,D first and then insert all
the answers into the database instead of getting each form's answers
and update the database each time when people click the continue/sumit
button on each page.
The problem is now I'm using 'import_request_variables' to get the
answers from A. It successfully brings all the answers to B/C (I tried
it by using echo), but when I try to get A's answers in D/the thank
you page. It doesn't work (tho I tried to use
'import_request_variables' to get A's answers in D/thank you page ).
Hmmm ... so it seems you're not redirecting from A to B/C and from B/C
to D after all, or are you?
If A posts to a redirector script and you do a header() there for B/C
the data from A doesn't automatically show up in B/C. How did you do
that?
So, I would like to know if there's any way to get the answers from A
to D/thank you page through B/C?
You have to save A answers inside B/C.
B/C answers will then include A answers (unchanged)
D will get B/C answers (including A answers) and pass them all to the
"thank you" page.
I'd probably go about that like this (using redirector scripts):
A: normal form, nothing fancy, action to redirector
the redirector will get A answers and pass them on to B/C the way
you are already doing it.
B/C: normal form, action to Dredirector
The form will have a hidden field with the A answers serialized.
The Dredirector will had B/C data to the serialized data and put
that into a hidden field in the D form
D: normal form, action to "thank you" page
"thank you" page gets the D data, which you can unserialize to get
the full A, B/C, D data
http://www.php.net/serialize http://www.php.net/unserailize
HTH
--
USENET would be a better place if everybody read: : mail address :
http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
http://www.expita.com/nomime.html : to 10K bytes :