Different Receipients depending on selection of radio button
Hi, Consider me a non-programmer. I am a newbie and I need help on my creation of form. I have here the code below (the portion I wanted to have recipients when chosen a desired branch:
<input name="center" type="radio" value="Manila">SBR Manila (Main Office)<br />
<input name="center" type="radio" value="Rizal">SBR Rizal<br />
<input name="center" type="radio" value="Aklan">SBR Aklan<br />
<input name="center" type="radio" value="Iloilo">SBR Iloilo<br />
<input name="center" type="radio" value="Cebu City, Cebu">SBR Cebu @ Cebu City<br />
<input name="center" type="radio" value="Mandaue City, Cebu">SBR Cebu @ Mandaue City<br />
<input name="center" type="radio" value="Talisay City, Cebu">SBR Cebu @ Talisay City<br />
<input name="center" type="radio" value="Bohol">SBR Bohol<br />
<input name="center" type="radio" value="Cagayan De Oro">SBR Cagayan De Oro<br />
<input name="center" type="radio" value="Davao">SBR Davao<br />
<input name="center" type="radio" value="General Santos">SBR General Santos
...and in my message_sent.php, here is the complete codes i researched to use:
<?php
session_start();
if(($_SESSION['security_code'] == $_POST['security_code']) && (!empty($_SESSION['security_code'])) ) {
$message = "Last Name : ".$_REQUEST['lastname']."\n";
$message .= "Middle Name : ".$_REQUEST['middlename']."\n";
$message .= "First Name : ".$_REQUEST['firstname']."\n";
$message .="Email Address : ".$_REQUEST['eadd']."\n";
$message .="Contact Number : ".$_REQUEST['contact']."\n";
$message .= "Exam to Take: ".$_REQUEST['review']."\n";
$message .= "Desired Center: ".$_REQUEST['center']."\n";
$message .="Message :".$_REQUEST['message']."\n\n";
$emailadd = $_REQUEST['eadd'];
mail( $to, "SBR Online Inquiry", $message, "From: $emailadd ");
mail( $to['center'], "SBR Online Inquiry", $message, "From: $emailadd ");
// i want this to cc email
mail( "my_email@yahoo.com", "SBR Online Inquiry", $message, "From: $emailadd ");
mail( "his_email@yahoo.com", "SBR Online Inquiry", $message, "From: $emailadd ");
header('Location:thank_you.php');
unset($_SESSION['security_code']);
} else {
header('Location: contact_us.php?failed=not');
}
?>
Any help will be very much appreciated.
Thanks