473,568 Members | 2,935 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2423
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********@yaho o.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*********@wil lglen.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
2215
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 something wrong with the code that fread() and fopen() the file, but what? The inclusion file below, which diplays the form: <?php print...
7
1664
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, why else would I post? Well, here goes: CODE $adres = trim (htmlspecialchars($_POST)); $verkocht = trim (htmlspecialchars($_POST));...
11
3235
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 just display it below: The following code contains the script to process the uploaded file, the form to upload the file and then a few links to...
4
2717
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 my items and I can review things at anytime - on the desktop where I created all this - no problem so far. I networked the mdb file (only) across...
6
2069
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 stored in the database using a Transaction Object, That inserts data, entered by user in both the forms, in the database. My problem is where shall i...
9
2052
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. Assign to a datarow (dr1) the first record of the MASTER table 2. Assign to another datarow (dr2) the second record of the MASTER table 3. If...
22
2517
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' account and submitted them under that, but this makes it harder to print lists of all the reviews by one person, so ideally I wanna make a multiple...
9
5488
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 able to help out. I have some serialized data that I would like to store in a MySQL database. When viewed, the serialized data looks like this: ...
2
3581
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 vertices in that graph to each other. I can see that my hard-drive is working very hard throughout the operation. The operation took about 2 hours (I...
0
7693
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7665
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6277
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5501
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.