|
Posted by Tyrone Slothrop on 10/12/53 11:38
On 18 Jan 2006 06:48:31 -0800, "pmAgony" <fncuis@gmail.com> 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@somedomain.com"; break;
case 2: $sendto = "mary@somedomain.com"; break;
case 3: $sendto = "tom@somedomain.com"; break;
case 4: $sendto = "jill@somedomain.com"; break;
default: "admin@somedomain.com";
}
This assumes that the select passes 1-4 as values.
Navigation:
[Reply to this message]
|