I have 4 different dynamic variables that change per user (age, gender, country, approval rating)
What I need to do if create a conditional if statement where it checks to see if all or any are correct. I can get it to work with all, and can get it to check if the user's age is within the accepted age range using the below code, but it skips the rest of one one of them is correct. I need it to check each one seperately.
Example:
$myRating = $_SESSION['approval'];
$myGender = $_SESSION['gender'];
$myCountry = $_SESSION['country'];
$myAge = $_SESSION['age'];
$taskRating = $thisTask['ap_perc'];
$taskGender = $thisTask['gender'];
$taskCountry = $thisTask['country'];
$minAge = $thisTask['min_age'];
$maxAge = $thisTask['max_age'];
if($myAge >= $minAge & $myAge <= $maxAge OR $myRating >= $taskRating OR $myGender == $taskGender OR $myCountry == $taskCountry & $myRating >= $taskRating & $myGender == $taskGender & $myCountry == $taskCountry){
Ideally, the "task" will have requirements, such as Age Range (say 18-25), Gender, Country, and approval rating. If a user creates a task with the following requirements:
Ages 18-25 Female Only, in the US with an approval rating of 95% it works fine. However, if only a one or two variables are set (default with no requirements is "all" then it doesn't work. For example:
Ages 18-25, All Genders, in the US with any approval rating. This doesn't work.