473,225 Members | 958 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,225 software developers and data experts.

Storing variables in forms and insert to database

Hi all,

Newbie here!!

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 ).

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?

Hope the question is not confusing....
Thank you for everyone who answers my question!!

Venus
Jul 17 '05 #1
2 2397
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 :
Jul 17 '05 #2

On 31-Mar-2004, fr********@yahoo.com.hk (Venus) wrote:
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 ).

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 a couple of choices:

1) You can start a session and store the values in $_SESSION
2) You can put the values from A into B and C as hidden fields ( <input
type=hidden ... )
--
Tom Thackrey
www.creative-light.com
tom (at) creative (dash) light (dot) com
do NOT send email to ja*********@willglen.net (it's reserved for spammers)
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: pescott | last post by:
Hello people, I could really use your help on this one... I have script to upload image data to a database, but all that is uploaded is the decription, not the data BLOB itself. There must be...
7
by: pescott | last post by:
I am still struggling to get some files uploaded to a database as BLOB data. I have 5 includes which allows the user to upload 5 files, numbered accordingly. However, there are script errors. Duhh,...
11
by: bissatch | last post by:
Hi, I am trying to upload an image, create a new file based on that image and then store the base64 encoded image data in a database. I dont really know where my code is going wrong so I will...
4
by: Rednelle | last post by:
Greetings all, As a newbie, using Access 2000, I would appreciate advice on the best way to include pictures. I have developed a 'Home Inventory' database which can include jpeg thumbnails of...
6
by: Saket Mundra | last post by:
I have a web application with two forms. After user enters data in first form he is directed to the second form. After Filling the second form as he clicks on save button, the data entered is...
9
by: Brad | last post by:
I have written some code to manipulate data/records in a MASTER (order header) and DETAIL (order details) tables. What I have written is too extensive to post but essentially trying to: 1....
22
by: guitarromantic | last post by:
Hey everyone, I run a site with staff-submitted reviews, and most of them are written by one author. However, we also do "multiple" reviews. Up until now I just had a userid for a 'Multiple'...
9
by: PI | last post by:
Hi Guys, I need some assistance with the following scenario please. I know this might be more of a MySQL post than a PHP one, but it is likely some developer has been here before and would be...
2
by: aeblank | last post by:
THE PROBLEM I'm running into performance issues generating and storing a randomly created graph in a SQL Server database. I have a T-SQL script that generates a graph, and then randomly connects the...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.