I have currently got some php which sends a form to an email when it is completed. The issue is, I want the form to submit when two options must be selected not all of the options.
The form is a basic input form with 5 options, 2 of them being required.
<?php
///I thought this would work since I'm only requesting two inputs V
if (isset($_POST['optionOne']) && isset($_POST['option'])){
$optionOne=$_POST['optionOne'];
$tick=$_POST['tick'];
$results=$_POST['results'];
$option=$_POST['option'];
$requirements=$_POST['requirements'];
$to= "bonniethompson12345@gmail.com";
$subject="submit";
$body="This course is identified in my Work Plan and Learning Agreement: $optionOne \n \n I am attending this session because: $tick \n \n What would you like to achieve as a result of your attendance: $results \n \n Do you require adjustments or additions to the session delivery to support your participation: $option \n \n Please provide details of your requirments: $requirements";
$send = mail($to, $subject, $body);
if ($send) {
echo 'message sent!';
}else {
echo "error";
}
}
?>