You are here: Re: Variable Drop Down « All PHP « IT news, forums, messages
Re: Variable Drop Down

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация