Skip to main content
Participant
May 17, 2006
Answered

list/menu data passing

  • May 17, 2006
  • 1 reply
  • 224 views
Im sure this is an easy one but it has me stumped. Here is the scenario:

I have a couple list/menu boxes that allow mulitple selections. I process a few other items through a php script that sends an e-mail out to a specified e-mail address. Everything works as planned except I only get the last item selected in the list/menu boxes all the way through to the e-mail.

I have tried adding the ' [ ] ' syntax as discussed in a few other articles but have not been able to get this to work.

Can anyone offer any help? I would be more than glad to explain myself further or attach some code. Thanks in advance!

Sean
This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer Sean_Akers
Ok I got the fix.

I added the '[ ]' on the variable in the form, so the code looks like this:

<select name="email[]" size="4" multiple id="email">
<option value="1 Accounting">1 Accounting</option>
<option value="1 Adjustments">1 Adjustments</option>
</select>

Then I went to the script that processes the form and change my variable definitions to this:

$FTGemail = implode(',',$_POST['email']);

1 reply

Sean_AkersAuthorCorrect answer
Participant
May 19, 2006
Ok I got the fix.

I added the '[ ]' on the variable in the form, so the code looks like this:

<select name="email[]" size="4" multiple id="email">
<option value="1 Accounting">1 Accounting</option>
<option value="1 Adjustments">1 Adjustments</option>
</select>

Then I went to the script that processes the form and change my variable definitions to this:

$FTGemail = implode(',',$_POST['email']);