[thelist] sequential forms (PHP)

Martin Tsachev shaggy at members.evolt.org
Sat Apr 20 07:18:00 CDT 2002


On Thu, 18 Apr 2002 11:20:33 -1000, John Corry wrote:
>I have a site that has an ordering process that requires 2 forms.
>
>form 1 : display the item details and get the information for where the item
>is being shipped to form 2 : get the information for who the customer is and
>how they're paying confirmation page : display everything they submitted and
>ask them to confirm or edit they're choices
>
>So, how do I store all those variables through 3 pages?
>
>1) I use a 'temp' table in my db and link a visitor to their data via a
>session variable. Takes some time to set this up, but it's probably pretty
>robust
>2) I use 'hidden' form fields to hold the values from the previous page and to
>hold ALL of the values on the final page. (Or, when I ask them to confirm the
>order, I just display all of their choices in form fields so they can edit
>them right there on the confirmation page...that saves some work)

Pretty sloppy.

>3) Something else I'm not thinking of. I know when I submit a form, I have all
>of the variables of it's elements in the array $_POST, can I just pass the
>array to the next form in one hidden field?
><input type="hidden" name="form 1 values array" value="$_POST"> <= Seems like
>on form 2, this hidden field would contain all of form 1's $key, $value pairs,
>which I could then submit along with form 2's info to the confirmation page,
>at which point I can stop for the day and go to the beach.
>

Why not use sessions? That's what they've been developed to do.

--------------------------------------------

Martin Tsachev
http://members.evolt.org/shaggy/





More information about the thelist mailing list