I wasn’t able to combine to two scenarios so I decided to nest it. The problem is that the else condition doesn’t print. Any Ideas on how I can achieve this?
<?php
if($sMan == true || $gWoman == true || $gMan == true || $biMan == true || $biWoman == true || $sWoman == true) {
if($matchAge >= $idealAge_1 && $matchAge <= $idealAge_2) {
print "You have a match";
};
} else {
print "no match";
?>
<script type="text/javascript">
$(function () {
$('.approved:contains(no match)').addClass('no-match');
});
</script>
<?php
}
?>
Gandalf
October 15, 2015, 10:23am
3
What is your first if for? All it seems to do is confirm it’s a person.
Well judging that you have No Match inside the else tells me that the else belongs to the inside if condition, correct?
<?php
if($sMan == true || $gWoman == true || $gMan == true || $biMan == true || $biWoman == true || $sWoman == true) {
if($matchAge >= $idealAge_1 && $matchAge <= $idealAge_2) {
print "You have a match";
}else{
print "no match";
?>
<script type="text/javascript">
$(function () {
$('.approved:contains(no match)').addClass('no-match');
});
</script>
<?php
}
}
?>
system
Closed
January 14, 2016, 10:57pm
5
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.