473,320 Members | 1,856 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,320 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 2407
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.