|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
|||
|
|||
|
dealing with multiple select boxes and $_POST
ok folks, grabbing stuff out of $_POST and then I come to the multiple select boxes I have
In the array for $_POST it just says Select as the key and no as the value (the value of the last select) my question is how the heck do I get the rest? I thought that the value might return as an array so I tried to print_r that, got nothing useful. So how do I pull the select values out of the $_POST???? |
|
#2
|
|||
|
|||
|
RE: dealing with multiple select boxes and $_POST
You can name each select box:
<SELECT name="something"> <OPTION value="yes">Yes</OPTION> <OPTION value="no">No</OPTION </SELECT> you would then address that select box as $_POST['something'] You can also try naming them as an array, I haven't tried it but it should work: <SELECT name="something[]"> <OPTION value="yes">Yes</OPTION> <OPTION value="no">No</OPTION </SELECT> <SELECT name="something[]"> <OPTION value="yes">Yes</OPTION> <OPTION value="no">No</OPTION </SELECT> you should then be able to loop through: foreach($_POST['something'] as $something) { echo $something; } |
|
#3
|
|||
|
|||
|
RE: dealing with multiple select boxes and $_POST
DOH!!!!
you know the only time I get to code is a time when sadly I am constantly interrupted. I thought I WAS naming my selects with the field name but sadly I was just calling them all Select. I am sorry I didn't see this sooner. Thanks for helping me spot my mistake. |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > dealing with multiple select boxes and $_POST |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|