Skip to main content
Participant
May 17, 2006
Beantwortet

list/menu data passing

  • May 17, 2006
  • 1 Antwort
  • 225 Ansichten
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
Dieses Thema wurde für Antworten geschlossen.
Beste Antwort von 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 Antwort

Sean_AkersAutorAntwort
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']);