Why not split the form into several <DIV> tags where only one of them is
visible at a time.
A "Next" button will move the users to the next part of the form (Next
<DIV>). and a Previous
button will allow them to go back to the previous part of the form and
fix anything they like.
This way, you only actually submit once.
Sincerely
berber
Visit http://www.weberdev.com Today!!!
To see where PHP might take you tomorrow.
-----Original Message-----
From: Erik Price [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 06, 2002 5:34 PM
To: PHP
Subject: [PHP] passing large quantities of form data
I have a huge form that takes place over several pages. Well, actually
it's one script that calls itself many times. Passing the user data
from one instance of the script to another has certainly been
educational. (I am avoiding session variables for this particular
form.) I finally have the data display itself in a "Confirm?" page
instance, where all of the data aggregated is displayed for the user to
confirm. But I need to pass this data ONE MORE TIME to the part of the
script that actually adds it to the database.
Two questions about this:
1) most important question -- what is the most efficient way to pass
this POST data from the "confirm" page to the "add to database" page? I
was thinking of creating an array to contain the many POST variables,
like this:
$superformfield = array();
$superformfield[] = $_POST['name'];
$superformfield[] = $_POST['size'];
$superformfield[] = $_POST['resolution'];
$superformfield[] = $_POST['creator'];
... etc ...
Then taking $superform and placing it into a hidden form field, rather
than creating a new hidden form field for every single variable that I
want to pass. Is this when people use serialize() ? Demetrious S.
Kelly posted a function "encode()" which takes data and translates it to
ASCII numbers so that it becomes hidden-form-field-friendly. I'm
guessing the best thing to do is serialize() the data, then translate it
into ASCII numbers only, then store all of this info into one giant
hidden form field. I'm hoping there's no limit on hidden form field
size... then use Demetrious's decode() function on the next
instance/"page" of the script, to return the data to its original
characters and unserialize() -ing the characters to get my array back.
Then I can loop through the array and create my SQL statement. Does it
make any sense?
2) is this a lot of extra work, and I'd be better served by just taking
each variable and putting it into its own hidden form field?
Thanks!
"And remember, your answer is for posterity, so please try to be
honest."
-- the Six-Fingered Man
Erik
----
Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php