Re: Variable Drop Down
- From: Tyrone Slothrop <ts@xxxxxxxxxxxxx>
- Date: Wed, 18 Jan 2006 07:07:33 -0800
On 18 Jan 2006 06:48:31 -0800, "pmAgony" <fncuis@xxxxxxxxx> wrote:
>Hello-
>
>In my contact form, I have a drop down field that allows the user to
>choose what department they want to send inquiry's to. The field is
>labeled: "who".
>
>Each entry has a unique email address it needs to go to. How do I get
>my php script to recognize the value in "who" when potentially there
>are 4 different values stored in the "who" array?
>
>Then I need to drop in the 'if' value 3 is selected, mail($sendto);
>
>Can someone shead some knowledge?
>
>Thanks-
When the form is posted, evaluate the value of the selected item:
switch ($_POST['who'] {
case 1: $sendto = "bob@xxxxxxxxxxxxxx"; break;
case 2: $sendto = "mary@xxxxxxxxxxxxxx"; break;
case 3: $sendto = "tom@xxxxxxxxxxxxxx"; break;
case 4: $sendto = "jill@xxxxxxxxxxxxxx"; break;
default: "admin@xxxxxxxxxxxxxx";
}
This assumes that the select passes 1-4 as values.
.
- Follow-Ups:
- Re: Variable Drop Down
- From: pmAgony
- Re: Variable Drop Down
- From: pmAgony
- Re: Variable Drop Down
- From: J.O. Aho
- Re: Variable Drop Down
- References:
- Variable Drop Down
- From: pmAgony
- Variable Drop Down
- Prev by Date: Variable Drop Down
- Next by Date: click count
- Previous by thread: Variable Drop Down
- Next by thread: Re: Variable Drop Down
- Index(es):
Relevant Pages
|