I am having a bit of trouble getting this if statement to work correctly. There is a drop down on the page with two options. If the user selects one option, a few more fields appear and if they select the other option, a different set of fields appear. So, I need those fields to be mandatory. This code does that, however if the user selects option "airTransfer" it is still requiring the fields for "hourly", which the user cannot even see.
PHP
//Requiring Airline Fields
if ($service == "airTransfer" AND
$airline == "" OR
$flight == "" OR
$landing == "") {
echo "Please enter your flight information.";
exit;
}
//Requiring Hourly Fields
if ($service == "hourly" AND
$occasion == "" OR
$start == "" OR
$end == "" OR
$pickup == "" OR
$hours == "") {
echo "Please enter all event details.";
exit;
}
if ($service == "airTransfer" AND ( .. rest conditions .. )) {and ` if ($service == "hourly" AND ( .. rest conditions .. )) {`if ($service == "airTransfer" AND ($airline == "" OR $flight == "" OR $landing == "")) {echo "Please enter your flight information."; exit;}