For Programmers: Free Programming Magazines  


Home > Archive > PHP Programming > February 2007 > email person based on radio and select selections









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author email person based on radio and select selections
schwooba@gmail.com

2007-02-27, 7:01 pm

Hello...I have an html form with radio and select controls that I want
to email to a user but can't quite grasp the way I should set this up.

If someone selects "a" and "milk" I want it to email abc. If they
select "a" and "cookies" it should go to xyz. Any help would be
appreciated.

input type="radio" name="type" value="a"
input type="radio" name="type" value="b"
input type="radio" name="type" value="c"

<select name="location">
<option>milk</option>
<option>cookies</option>
</select>

Kimmo Laine

2007-02-27, 7:01 pm

schwooba@gmail.com kirjoitti:
> Hello...I have an html form with radio and select controls that I want
> to email to a user but can't quite grasp the way I should set this up.
>
> If someone selects "a" and "milk" I want it to email abc. If they
> select "a" and "cookies" it should go to xyz. Any help would be
> appreciated.
>
> input type="radio" name="type" value="a"
> input type="radio" name="type" value="b"
> input type="radio" name="type" value="c"
>
> <select name="location">
> <option>milk</option>
> <option>cookies</option>
> </select>
>


if($_POST['type']=='a'){
if($_POST['location']=='milk'){
$reciever='abc';
} else if($_POST['location']=='cookies'){
$reciever='xyz';
}
... and so on...
}

then you just mail() to $reciever. No rocket science included.

--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviö
spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com