Re: Variable Drop Down



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.


.



Relevant Pages

  • Variable Drop Down
    ... my php script to recognize the value in "who" when potentially there ... are 4 different values stored in the "who" array? ... Can someone shead some knowledge? ... Prev by Date: ...
    (alt.php)
  • Re: Looking for speed performance to draw line.
    ... each item in an array, that being the next and/or previous indexes. ... and it's next pointer to the previous item's original next pointer. ... Next -1, Prev 0 ... shapes up into shape classes that implemented the required commands ...
    (microsoft.public.vb.winapi.graphics)
  • Re: Sieve of Eratosthenes
    ... >php script which doesn't work properly - actually it doesn't work at ... quick google found the following pseudocode ... Set up an array of integers z: ... print all unmarked multiples. ...
    (comp.lang.php)
  • Re: Reading a file in reverse order
    ... then just reverse the array or read backwords ... Mike Bradley http://www.gzentools.com -- free online php tools "Erik Andersson" wrote in message ... > I need to read a file in reverse order, without reading the> whole file into memory first. ... > </output from php script> ...
    (comp.lang.php)
  • Re: Multiple Condition Sumif Formula
    ... Andy. ... > revenue column. ... > & I've tried to enter the formula as an array by doing ... Prev by Date: ...
    (microsoft.public.excel.worksheet.functions)