In other words, you need to be more careful about enclosing your blocks of code within the correct if...elseif...else structure.
- Code: Select all
if (420 > 1) {
// code here will definitely be executed
} elseif (365 > 1) {
/* although 365 IS > 1, this won't be executed
because the 420 > 1 branch evaluated true */
}
// code here will be excuted regardless of whether 420 or 365 >1
// so will this because it's actually outside the if structure
else {
// this code won't ever be executed because 420 > 1.
}
// endif is very old code and not needed if you use curly braces to enclose if structure.