Re: [PHP] php and forms question
Chip: Sessions aren't my forte, but I can't see where you're registering your session variables. You need to do more than simply use 'session_start' if using sessions ... perhaps you're doing this on another page, but if not you'll need to register variables using 'session_register'. You'll also need 'session_id' as far as I know. The manual at www.php.net should fill you in some more, and there are a couple of tutes out there as well (www.devshed.com has one I think). Mick On Tue, 30 Jan 2001, Chip wrote: Michael Hall wrote: , you have session variables or writing information a database or file. Hi Michael, I have set up a couple test pages using session variable like this: --- ? session_start(); ? html head /head body ? if (isset($radars_form)) { $products = $radars_form; session_register( "products" ); print "pYour products have been registered/p"; } ? form method=post select name="radars_form[]" multiple size=6 optionRA772 optionRA40 Series optionRA720 optionRA723 optionRA725 optionRA713 optionRadars General /select p / input type="submit" value="choose" /form a href="autopilots_form.php"Next page/a /body /html -- then the second page like this - -- ? session_start(); ? html head /head body ? if (isset($autopilots_form)) { $products = $autopilots_form; session_register( "products" ); print "pYour products have been registered/p"; } ? form method=post select name="autopilots_form[]" multiple size=6 optionap11 optionap12/ap14 optionap20 series optionap35 optionap45 optionap9mk3 optiontiller/wheel pilots optionwp5000 /select p / input type="submit" value="choose" /form a href="plotters_form.php"Next page/a /body /html --- and the last one like this --- ? session_start(); print session_encode(); ? html head /head body ? if ( isset($autopilots_form)) { print "Your choices:ol"; foreach ( $autopilots_form as $p ) print "li$p"; } if ( isset($radars_form)) { print "Your choices:ol"; foreach ( $radars_form as $p ) print "li$p"; } ? a href="radars_form.php"back/a /body /html - The last won't work right because of the if statements. How do I get it to print all the results? I tried adding and between the if statements, but that doesn't work, as I expected, I don't see anything in my php books that will help with this bit. I want to be able to pick items from all pages, and at the end print them to the screen and email them to a person. I welcome any help I can get, Thanks Chip Wiegand Mick On Tue, 30 Jan 2001, Chip wrote: I am trying to build a multi-part form and am using the example from the book Beginning PHP4 by Choi, Kent, Lea, et al. in chapter 8. Here's what I want to do - form_page1 - 10 input fields size=3 then onwards to form_page2 - 5 input fields size=3 then onwards to form_page3 - 5 input fields size=3 (and about 5 or 6 pages more) form_page10 has submit button then the thankyou page with a list of the items chosen on the previous pages. These items will be brochures, the text-boxes are for a quantity. Most people will only want one but our authorized dealers can order as many as they need, whence the need for the size being 3 characters. In the example in the book they use a drop- down list, so only one item on the list can be chosen, this won't work for me. How do I store all the choices from each subsequent page and bring them all together on the final page? Thankyou, -- Chip Wiegand Alternative Operating Systems www.wiegand.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php and forms question
One way to do this is to include information in hidden form fields that pass information along from page to page. If this is too unwieldy, you have session variables or writing information a database or file. Mick On Tue, 30 Jan 2001, Chip wrote: I am trying to build a multi-part form and am using the example from the book Beginning PHP4 by Choi, Kent, Lea, et al. in chapter 8. Here's what I want to do - form_page1 - 10 input fields size=3 then onwards to form_page2 - 5 input fields size=3 then onwards to form_page3 - 5 input fields size=3 (and about 5 or 6 pages more) form_page10 has submit button then the thankyou page with a list of the items chosen on the previous pages. These items will be brochures, the text-boxes are for a quantity. Most people will only want one but our authorized dealers can order as many as they need, whence the need for the size being 3 characters. In the example in the book they use a drop- down list, so only one item on the list can be chosen, this won't work for me. How do I store all the choices from each subsequent page and bring them all together on the final page? Thankyou, -- Chip Wiegand Alternative Operating Systems www.wiegand.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php and forms question
Michael Hall wrote: , you have session variables or writing information a database or file. Hi Michael, I have set up a couple test pages using session variable like this: --- ? session_start(); ? html head /head body ? if (isset($radars_form)) { $products = $radars_form; session_register( "products" ); print "pYour products have been registered/p"; } ? form method=post select name="radars_form[]" multiple size=6 optionRA772 optionRA40 Series optionRA720 optionRA723 optionRA725 optionRA713 optionRadars General /select p / input type="submit" value="choose" /form a href="autopilots_form.php"Next page/a /body /html -- then the second page like this - -- ? session_start(); ? html head /head body ? if (isset($autopilots_form)) { $products = $autopilots_form; session_register( "products" ); print "pYour products have been registered/p"; } ? form method=post select name="autopilots_form[]" multiple size=6 optionap11 optionap12/ap14 optionap20 series optionap35 optionap45 optionap9mk3 optiontiller/wheel pilots optionwp5000 /select p / input type="submit" value="choose" /form a href="plotters_form.php"Next page/a /body /html --- and the last one like this --- ? session_start(); print session_encode(); ? html head /head body ? if ( isset($autopilots_form)) { print "Your choices:ol"; foreach ( $autopilots_form as $p ) print "li$p"; } if ( isset($radars_form)) { print "Your choices:ol"; foreach ( $radars_form as $p ) print "li$p"; } ? a href="radars_form.php"back/a /body /html - The last won't work right because of the if statements. How do I get it to print all the results? I tried adding and between the if statements, but that doesn't work, as I expected, I don't see anything in my php books that will help with this bit. I want to be able to pick items from all pages, and at the end print them to the screen and email them to a person. I welcome any help I can get, Thanks Chip Wiegand Mick On Tue, 30 Jan 2001, Chip wrote: I am trying to build a multi-part form and am using the example from the book Beginning PHP4 by Choi, Kent, Lea, et al. in chapter 8. Here's what I want to do - form_page1 - 10 input fields size=3 then onwards to form_page2 - 5 input fields size=3 then onwards to form_page3 - 5 input fields size=3 (and about 5 or 6 pages more) form_page10 has submit button then the thankyou page with a list of the items chosen on the previous pages. These items will be brochures, the text-boxes are for a quantity. Most people will only want one but our authorized dealers can order as many as they need, whence the need for the size being 3 characters. In the example in the book they use a drop- down list, so only one item on the list can be chosen, this won't work for me. How do I store all the choices from each subsequent page and bring them all together on the final page? Thankyou, -- Chip Wiegand Alternative Operating Systems www.wiegand.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]