RE: select box in formailer

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
johnh
Forum Newbie
Posts: 3
Joined: Mon Apr 22, 2002 10:48 am
Location: ohio

RE: select box in formailer

Post by johnh »

hello all was wondering if anyone would know if it is possible to change the $toaddress in a form submission by what dropdown box is selected . kinda like
<?
if ($select==1)
toaddress ="lalala@yayaya";
elseif ($select==2)
toaddress="jjje@yadayada.com";
if ($select==0)
{ return;
echo"no box was selected";
{
?>
User avatar
enygma
Site Admin
Posts: 175
Joined: Fri Apr 19, 2002 8:29 am
Location: Dallas, Tx

Post by enygma »

personally I'd just use a switch:

Code: Select all

switch($input)&#123;
  case "1": $to="me@me.com"; break;
  case "2": $to="you@you.com"; break;
  case "3": $to="them@them.com"; break;
&#125;
-enygma
User avatar
johnh
Forum Newbie
Posts: 3
Joined: Mon Apr 22, 2002 10:48 am
Location: ohio

Post by johnh »

8) cool will try that .with any luck the form may be smarter...LOL
Post Reply