I am trying to create a survey form that emails the results to an email address - not a database
None of the radio buttons are pre-selected.
If I submit the form without choosing any of the buttons I receive the following error -
Notice: Undefined index: radio_group_1 in /public_html/processForm.php on line 8
Fill All Fields..
if(isset($_POST["send_message"])){
if($_POST["radio_group_1"]==""||$_POST["radio_group_2"]==""||$_POST["radio_group_3"]==""||$_POST["radio_group_4"]==""||$_POST["radio_group_5"]==""||$_POST["radio_group_6"]==""||$_POST["radio_group_7"]==""||$_POST["radio_group_8"]==""||$_POST["radio_group_9"]==""||$_POST["radio_group_10"]==""||$_POST["sender_message"]==""){
echo "Fill All Fields..";
}else{
$mail_to = "email@account";
$message = $_POST['sender_message'] = preg_replace("/\r|\n/", "", $_POST['sender_message']);
$data = strip_tags(trim($message));
$question1 = $_POST['radio_group_1'];
$question2 = $_POST['radio_group_2'];
$question3 = $_POST['radio_group_3'];
$question4 = $_POST['radio_group_4'];
$question5 = $_POST['radio_group_5'];
$question6 = $_POST['radio_group_6'];
$question7 = $_POST['radio_group_7'];
$question8 = $_POST['radio_group_8'];
$question9 = $_POST['radio_group_9'];
$question10 = $_POST['radio_group_10'];
This is an example of one of the radio button groups
<label for="radio_1">
<input type="radio" name="radio_group_1" value="1" id="radio_1">
1</label>
<label for="radio_2">
<input type="radio" name="radio_group_1" value="2" id="radio_2">
2</label>
<label for="radio_3">
<input type="radio" name="radio_group_1" value="3" id="radio_3">
3</label>
<label for="radio_4">
<input type="radio" name="radio_group_1" value="4" id="radio_4">
4</label>
<label for="radio_5">
<input type="radio" name="radio_group_1" value="5" id="radio_5">
5</label>