I have 2 forms that both point to the same functions.php page
1 form has 2 input fields, Vechile Type and Pricing, the other form has 3 input types, Vechile Type Pricing and Coverage Region
if ($_POST['vehicleType'] == 'lgv' && $_POST['pricing'] == 'fixed' ) {
// Query
}
else if ($_POST['vehicleType'] == 'lgv' && $_POST['pricing'] == 'pump' ) {
// Query
}
else if ($_POST['vehicleType'] == 'lgv' && $_POST['pricing'] == 'fixed' && $_POST['coverageRegion'] == 'national' ) {
// Query
}
else if ($_POST['vehicleType'] == 'lgv' && $_POST['pricing'] == 'pump' && $_POST['coverageRegion'] == 'international' ) {
// Query
}
Now my statement above doesnt work, im new to PHP so please excuse my naivity, but I only want the first 2 queries to run from the homepage, where only 2 variables are set, and the second 2 queries to run when the other form is filled in.
Is there a way I can say if coverageRegion isnt set, run the first 2?
1 Answer