[PHP] Why doesn't this work? Please trouble-shoot my script.
Hi, Maybe someone can take a look at the script below and tell how to make the bottom part work the same way the top part works. The top part (select box) works where the one item chosen is written to a hidden file and passed on to the next page, then on and on through several more pages and to the last page that emails the chosen items to our marketing dept. Problem is, it only allows one choice at a time. I tried it with the multiple option set but the final form shows only the last item chosen from the list of multiple items. So I tried with the checkboxes, but that doesn't work at all. !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" html head titleSimrad USA Brochures Request Page/title /head body form method = post action = 'form_combos.php' ? $name; $value; while (list($name, $value) = each($HTTP_POST_VARS)) { echo "input type=\"hidden\" value=\"$value\" name=\"$name\"\n"; } ? Please choose the brochures you are interested in receiving. select name = 'listbox1' option selected value = ''Select .../option optionAP11/option optionAP12/AP14/option optionAP20 Series/option optionAP35/option optionAP45/option optionAP9MK3/option optionTiller/Wheel Pilots/option optionWP5000/option /selectbr /br / br / br / input type="checkbox"AP11br / input type="checkbox"AP12/14br / input type="checkbox"AP20 Seriesbr / input type="checkbox"AP35br / input type="checkbox"AP45br / input type="checkbox"AP9MK3br / input type="checkbox"Tiller/Wheelpilotsbr / input type="checkbox"WP5000br / br / br / input type = submit /form /body /html --- On the checkboxes I had at first specified the name and value fields, but that didn't work either. My goal is to have the above list allow multiple choices that are passed to the next page, and so on through about 6 pages to the final page. Even better yet would be a text box where the end-user could specify a quantity of brochures, for multiple choices, that would be my preferred form. Thankyou for your help, Chip Wiegand Computer Services [EMAIL PROTECTED] Simrad, Inc Lynnwood, WA 425-712-1138 "There is no reason anyone would want a computer in their home." --Ken Olson, president, chairman and founder of Digital Equipment Corp., 1977 (-- Then why do I have nine? Somebody help me!) -- 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] Why doesn't this work? Please trouble-shoot my script.
I tried your suggestion, as you can see from the script below, but it still does not work, I get the word 'array' where I should get the selected options. -- !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" html head titleSimrad USA Brochures Request Page/title /head body form method = post action = 'form_combos.php' ? $name; $value; while (list($name, $value) = each($HTTP_POST_VARS)) { echo "input type=\"hidden\" value=\"$value\" name=\"$name\"\n"; } ? Please choose the brochures you are interested in receiving. select name = "listbox1[]" multiple="multiple" option selected value = ''Select .../option optionAP11/option optionAP12/AP14/option optionAP20 Series/option optionAP35/option optionAP45/option optionAP9MK3/option optionTiller/Wheel Pilots/option optionWP5000/option /select br / br / input type="checkbox" name="AP11[]"AP11br / input type="checkbox" name="AP12[]"AP12/14br / input type="checkbox" name="AP20[]"AP20 Seriesbr / input type="checkbox" name="AP35[]"AP35br / input type="checkbox" name="AP45[]"AP45br / input type="checkbox" name="AP9[]"AP9MK3br / input type="checkbox" name="TP[]"Tiller/Wheelpilotsbr / input type="checkbox" name="WP[]"WP5000br / br /br / input type = submit /form /body /html Chip Wiegand Computer Services [EMAIL PROTECTED] Simrad, Inc Lynnwood, WA 425-712-1138 "There is no reason anyone would want a computer in their home." --Ken Olson, president, chairman and founder of Digital Equipment Corp., 1977 (-- Then why do I have nine? Somebody help me!) Please respond to [EMAIL PROTECTED] To: Chip Wiegand cc: Subject: Re: [PHP] Why doesn't this work? Please trouble-shoot my script. On Monday, February 5, 2001, at 10:59 AM, [EMAIL PROTECTED] wrote: Maybe someone can take a look at the script below and tell how to make the bottom part work the same way the top part works. put square brackets immediately after the name element of your select and checkbox tags. i.e.: select name="mySelect[]" multiple="multiple" checkbox name="myBox[]" :: Andrew Rush :: Lead Systems Developer :: MaineToday.com :: ** "Crippled but free, blind all the time, i was learning to see" - J. Garcia / R. Hunter ** The views expressed herein are not necessarily those of my employer, but they let me have them anyway. -- 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]