By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,664 Members | 1,623 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,664 IT Pros & Developers. It's quick & easy.

email person based on radio and select selections

P: n/a
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>

Feb 27 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
sc******@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ö
sp**@outolempi.net | Gedoon-S @ IRCnet | rot13(xv***@bhgbyrzcv.arg)
Feb 27 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.