Re: [PHP] multple select forms... going to hit my head against a wall ..
If you don't put it in a session var, and need to transport it you can use f. x. : This puts double pipe-chars between the array variables. You can later (when u need to use the vars again) use: $select = explode( "||", $user_selections ); to put it into an array again. -J - Original Message - From: <[EMAIL PROTECTED]> To: "Adrian Murphy" <[EMAIL PROTECTED]> Cc: "PHP list" <[EMAIL PROTECTED]> Sent: Tuesday, January 23, 2001 1:26 PM Subject: Re: [PHP] multple select forms... going to hit my head against a wall .. > Having soved this .. thanks .. now for the next question .. *grin* > > I have the $select ... but I only use it on the next page .. heheh > so I'm trying the following .. > > > > which of course doens't work .. nor does > > > > any idea on how to pass an array on in an input field in a form ? > > Henti > > > > On Tue, Jan 23, 2001 at 12:01:40PM -, Adrian Murphy wrote: > > hey, > > since u are slecting multiple options you'll have to use an array > > here's how.i u need explanation,feel free to mail me: > > > > > if ($select==""){ > > print" > > > > > > Chocolate/Chocolate Chip > > Peanut Brittle/Vanilla > > Cookie Batter > > Vanilla/Blueberry > > Caramel Swirl > > Other... > > > > > > > > "; > > > > }else{ > > > > ///count array > > $num = count($select); > > > > file://loop through array > > for($i = 0;$i <$num;$i++){ > > print $select[$i] . ""; > > } > > } > > ?> > > - Original Message - > > From: <[EMAIL PROTECTED]> > > To: PHP list <[EMAIL PROTECTED]> > > Sent: Tuesday, January 23, 2001 11:42 AM > > Subject: [PHP] multple select forms... going to hit my head against a wall > > .. > > > > > > > Hi all > > > > > > I'm having a slight little problem .. I can't seem to solve.. > > > > > > I have a multiple select form .. that i select mutiple options from and > > then it creates a variable called $select > > > now if I display $select .. I only get the last selected value .. here > > foloows test code.. > > > > > > > > if ($select==""){ > > > print" > > > > > > > > > Chocolate/Chocolate Chip > > > Peanut Brittle/Vanilla > > > Cookie Batter > > > Vanilla/Blueberry > > > Caramel Swirl > > > Other... > > > > > > > > > > > > "; > > > > > > }else{ > > > > > > print $select; > > > > > > } > > > ?> > > > > > > I'm de missing something ... can sombody please lend a hand .. thanks > > > > > > Henti Smith > > > > > > > > > -- > > > 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] > > > > -- > 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] multple select forms... going to hit my head against a wall ..
Sorry, my bad. I should have spotted the cunning way he used the word "array", really :-) Eyes closing. More coffee. aahaahhhrrrghhh Cheers Jon -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 23 January 2001 12:45 To: Jon Haworth Cc: '[EMAIL PROTECTED]' Subject: Re: [PHP] multple select forms... going to hit my head against a wall .. u ... $select is an array .. so echo $select will just produce "array" .. On Tue, Jan 23, 2001 at 12:44:20PM -, Jon Haworth wrote: > Try either: > > ?> > > OR > > printf ("input type=\"hidden\" name=\"select\" value=\"%s\">", > $select); > > > HTH > Jon > > > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: 23 January 2001 12:27 > To: Adrian Murphy > Cc: PHP list > Subject: Re: [PHP] multple select forms... going to hit my head against > a wall .. > > > Having soved this .. thanks .. now for the next question .. *grin* > > I have the $select ... but I only use it on the next page .. heheh > so I'm trying the following .. > > > > which of course doens't work .. nor does > > > > any idea on how to pass an array on in an input field in a form ? > > Henti > > > > On Tue, Jan 23, 2001 at 12:01:40PM -, Adrian Murphy wrote: > > hey, > > since u are slecting multiple options you'll have to use an array > > here's how.i u need explanation,feel free to mail me: > > > > > if ($select==""){ > > print" > > > > > > Chocolate/Chocolate Chip > > Peanut Brittle/Vanilla > > Cookie Batter > > Vanilla/Blueberry > > Caramel Swirl > > Other... > > > > > > > > "; > > > > }else{ > > > > ///count array > > $num = count($select); > > > > file://loop through array > > for($i = 0;$i <$num;$i++){ > > print $select[$i] . ""; > > } > > } > > ?> > > - Original Message - > > From: <[EMAIL PROTECTED]> > > To: PHP list <[EMAIL PROTECTED]> > > Sent: Tuesday, January 23, 2001 11:42 AM > > Subject: [PHP] multple select forms... going to hit my head against a wall > > .. > > > > > > > Hi all > > > > > > I'm having a slight little problem .. I can't seem to solve.. > > > > > > I have a multiple select form .. that i select mutiple options from and > > then it creates a variable called $select > > > now if I display $select .. I only get the last selected value .. here > > foloows test code.. > > > > > > > > if ($select==""){ > > > print" > > > > > > > > > Chocolate/Chocolate Chip > > > Peanut Brittle/Vanilla > > > Cookie Batter > > > Vanilla/Blueberry > > > Caramel Swirl > > > Other... > > > > > > > > > > > > "; > > > > > > }else{ > > > > > > print $select; > > > > > > } > > > ?> > > > > > > I'm de missing something ... can sombody please lend a hand .. thanks > > > > > > Henti Smith > > > > > > > > > -- > > > 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] > > > > -- > 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] > -- 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] multple select forms... going to hit my head against a wall ..
u ... $select is an array .. so echo $select will just produce "array" .. On Tue, Jan 23, 2001 at 12:44:20PM -, Jon Haworth wrote: > Try either: > > ?> > > OR > > printf ("input type=\"hidden\" name=\"select\" value=\"%s\">", > $select); > > > HTH > Jon > > > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: 23 January 2001 12:27 > To: Adrian Murphy > Cc: PHP list > Subject: Re: [PHP] multple select forms... going to hit my head against > a wall .. > > > Having soved this .. thanks .. now for the next question .. *grin* > > I have the $select ... but I only use it on the next page .. heheh > so I'm trying the following .. > > > > which of course doens't work .. nor does > > > > any idea on how to pass an array on in an input field in a form ? > > Henti > > > > On Tue, Jan 23, 2001 at 12:01:40PM -, Adrian Murphy wrote: > > hey, > > since u are slecting multiple options you'll have to use an array > > here's how.i u need explanation,feel free to mail me: > > > > > if ($select==""){ > > print" > > > > > > Chocolate/Chocolate Chip > > Peanut Brittle/Vanilla > > Cookie Batter > > Vanilla/Blueberry > > Caramel Swirl > > Other... > > > > > > > > "; > > > > }else{ > > > > ///count array > > $num = count($select); > > > > file://loop through array > > for($i = 0;$i <$num;$i++){ > > print $select[$i] . ""; > > } > > } > > ?> > > - Original Message - > > From: <[EMAIL PROTECTED]> > > To: PHP list <[EMAIL PROTECTED]> > > Sent: Tuesday, January 23, 2001 11:42 AM > > Subject: [PHP] multple select forms... going to hit my head against a wall > > .. > > > > > > > Hi all > > > > > > I'm having a slight little problem .. I can't seem to solve.. > > > > > > I have a multiple select form .. that i select mutiple options from and > > then it creates a variable called $select > > > now if I display $select .. I only get the last selected value .. here > > foloows test code.. > > > > > > > > if ($select==""){ > > > print" > > > > > > > > > Chocolate/Chocolate Chip > > > Peanut Brittle/Vanilla > > > Cookie Batter > > > Vanilla/Blueberry > > > Caramel Swirl > > > Other... > > > > > > > > > > > > "; > > > > > > }else{ > > > > > > print $select; > > > > > > } > > > ?> > > > > > > I'm de missing something ... can sombody please lend a hand .. thanks > > > > > > Henti Smith > > > > > > > > > -- > > > 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] > > > > -- > 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] > -- 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] multple select forms... going to hit my head against a wall ..
hey, in your form do this: } ?> then on the nex page use the same code i.e: $num = count($select); for($i = 0;$i <$num;$i++){ print $select[$i] . ""; } g'luck. - Original Message - From: <[EMAIL PROTECTED]> To: Adrian Murphy <[EMAIL PROTECTED]> Cc: PHP list <[EMAIL PROTECTED]> Sent: Tuesday, January 23, 2001 12:26 PM Subject: Re: [PHP] multple select forms... going to hit my head against a wall .. > Having soved this .. thanks .. now for the next question .. *grin* > > I have the $select ... but I only use it on the next page .. heheh > so I'm trying the following .. > > > > which of course doens't work .. nor does > > > > any idea on how to pass an array on in an input field in a form ? > > Henti > > > > On Tue, Jan 23, 2001 at 12:01:40PM -, Adrian Murphy wrote: > > hey, > > since u are slecting multiple options you'll have to use an array > > here's how.i u need explanation,feel free to mail me: > > > > > if ($select==""){ > > print" > > > > > > Chocolate/Chocolate Chip > > Peanut Brittle/Vanilla > > Cookie Batter > > Vanilla/Blueberry > > Caramel Swirl > > Other... > > > > > > > > "; > > > > }else{ > > > > ///count array > > $num = count($select); > > > > file://loop through array > > for($i = 0;$i <$num;$i++){ > > print $select[$i] . ""; > > } > > } > > ?> > > - Original Message - > > From: <[EMAIL PROTECTED]> > > To: PHP list <[EMAIL PROTECTED]> > > Sent: Tuesday, January 23, 2001 11:42 AM > > Subject: [PHP] multple select forms... going to hit my head against a wall > > .. > > > > > > > Hi all > > > > > > I'm having a slight little problem .. I can't seem to solve.. > > > > > > I have a multiple select form .. that i select mutiple options from and > > then it creates a variable called $select > > > now if I display $select .. I only get the last selected value .. here > > foloows test code.. > > > > > > > > if ($select==""){ > > > print" > > > > > > > > > Chocolate/Chocolate Chip > > > Peanut Brittle/Vanilla > > > Cookie Batter > > > Vanilla/Blueberry > > > Caramel Swirl > > > Other... > > > > > > > > > > > > "; > > > > > > }else{ > > > > > > print $select; > > > > > > } > > > ?> > > > > > > I'm de missing something ... can sombody please lend a hand .. thanks > > > > > > Henti Smith > > > > > > > > > -- > > > 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] > > > -- 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] multple select forms... going to hit my head against a wall ..
Try either: ?> ", $select); HTH Jon -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 23 January 2001 12:27 To: Adrian Murphy Cc: PHP list Subject: Re: [PHP] multple select forms... going to hit my head against a wall .. Having soved this .. thanks .. now for the next question .. *grin* I have the $select ... but I only use it on the next page .. heheh so I'm trying the following .. which of course doens't work .. nor does any idea on how to pass an array on in an input field in a form ? Henti On Tue, Jan 23, 2001 at 12:01:40PM -, Adrian Murphy wrote: > hey, > since u are slecting multiple options you'll have to use an array > here's how.i u need explanation,feel free to mail me: > > if ($select==""){ > print" > > > Chocolate/Chocolate Chip > Peanut Brittle/Vanilla > Cookie Batter > Vanilla/Blueberry > Caramel Swirl > Other... > > > > "; > > }else{ > > ///count array > $num = count($select); > > file://loop through array > for($i = 0;$i <$num;$i++){ > print $select[$i] . ""; > } > } > ?> > ----- Original Message ----- > From: <[EMAIL PROTECTED]> > To: PHP list <[EMAIL PROTECTED]> > Sent: Tuesday, January 23, 2001 11:42 AM > Subject: [PHP] multple select forms... going to hit my head against a wall > .. > > > > Hi all > > > > I'm having a slight little problem .. I can't seem to solve.. > > > > I have a multiple select form .. that i select mutiple options from and > then it creates a variable called $select > > now if I display $select .. I only get the last selected value .. here > foloows test code.. > > > > > if ($select==""){ > > print" > > > > > > Chocolate/Chocolate Chip > > Peanut Brittle/Vanilla > > Cookie Batter > > Vanilla/Blueberry > > Caramel Swirl > > Other... > > > > > > > > "; > > > > }else{ > > > > print $select; > > > > } > > ?> > > > > I'm de missing something ... can sombody please lend a hand .. thanks > > > > Henti Smith > > > > > > -- > > 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] > -- 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] multple select forms... going to hit my head against a wall ..
Having soved this .. thanks .. now for the next question .. *grin* I have the $select ... but I only use it on the next page .. heheh so I'm trying the following .. which of course doens't work .. nor does any idea on how to pass an array on in an input field in a form ? Henti On Tue, Jan 23, 2001 at 12:01:40PM -, Adrian Murphy wrote: > hey, > since u are slecting multiple options you'll have to use an array > here's how.i u need explanation,feel free to mail me: > > if ($select==""){ > print" > > > Chocolate/Chocolate Chip > Peanut Brittle/Vanilla > Cookie Batter > Vanilla/Blueberry > Caramel Swirl > Other... > > > > "; > > }else{ > > ///count array > $num = count($select); > > file://loop through array > for($i = 0;$i <$num;$i++){ > print $select[$i] . ""; > } > } > ?> > ----- Original Message - > From: <[EMAIL PROTECTED]> > To: PHP list <[EMAIL PROTECTED]> > Sent: Tuesday, January 23, 2001 11:42 AM > Subject: [PHP] multple select forms... going to hit my head against a wall > .. > > > > Hi all > > > > I'm having a slight little problem .. I can't seem to solve.. > > > > I have a multiple select form .. that i select mutiple options from and > then it creates a variable called $select > > now if I display $select .. I only get the last selected value .. here > foloows test code.. > > > > > if ($select==""){ > > print" > > > > > > Chocolate/Chocolate Chip > > Peanut Brittle/Vanilla > > Cookie Batter > > Vanilla/Blueberry > > Caramel Swirl > > Other... > > > > > > > > "; > > > > }else{ > > > > print $select; > > > > } > > ?> > > > > I'm de missing something ... can sombody please lend a hand .. thanks > > > > Henti Smith > > > > > > -- > > 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] > -- 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] multple select forms... going to hit my head against a wall ..
hey, since u are slecting multiple options you'll have to use an array here's how.i u need explanation,feel free to mail me: Chocolate/Chocolate Chip Peanut Brittle/Vanilla Cookie Batter Vanilla/Blueberry Caramel Swirl Other... "; }else{ ///count array $num = count($select); file://loop through array for($i = 0;$i <$num;$i++){ print $select[$i] . ""; } } ?> - Original Message - From: <[EMAIL PROTECTED]> To: PHP list <[EMAIL PROTECTED]> Sent: Tuesday, January 23, 2001 11:42 AM Subject: [PHP] multple select forms... going to hit my head against a wall .. > Hi all > > I'm having a slight little problem .. I can't seem to solve.. > > I have a multiple select form .. that i select mutiple options from and then it creates a variable called $select > now if I display $select .. I only get the last selected value .. here foloows test code.. > > if ($select==""){ > print" > > > Chocolate/Chocolate Chip > Peanut Brittle/Vanilla > Cookie Batter > Vanilla/Blueberry > Caramel Swirl > Other... > > > > "; > > }else{ > > print $select; > > } > ?> > > I'm de missing something ... can sombody please lend a hand .. thanks > > Henti Smith > > > -- > 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]
[PHP] multple select forms... going to hit my head against a wall ..
Hi all I'm having a slight little problem .. I can't seem to solve.. I have a multiple select form .. that i select mutiple options from and then it creates a variable called $select now if I display $select .. I only get the last selected value .. here foloows test code.. Chocolate/Chocolate Chip Peanut Brittle/Vanilla Cookie Batter Vanilla/Blueberry Caramel Swirl Other... "; }else{ print $select; } ?> I'm de missing something ... can sombody please lend a hand .. thanks Henti Smith -- 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]