IF statements insides the ELSEIF

I have several campaigns that I can show to a logged in user, depending on their account criteria. I only want one campaign to be shown when they login but I came across a problem while trying to implement multiple IF statements inside an ELSEIF. So is this even possible with PHP? Here is an example of my code. Why won’t the ELSE if work?

Thanks!



IF ($member == "Distributor") {

if ($totalLogins > 5) {

// run a sql query to find out how many leads they have
}
// execute lightbox
}

ELSEIF ($sentReferrals == "0")  {

// execute lightbox
}

ELSEIF ($submittedTestimonials < 1) {


if ($member == "Distributor") {

// run a sql query to find out the titles of each testimonial
}

// execute lightbox
}

ELSE {

print ("The user did not meet any of the criteria, therefore none of the campaigns were shown via a lightbox");
}


There is this thing called INDENTION…USE IT.


if () {
  if () {
    if () {
      if () {
        // and...so on...
      }
    }
  }
}

Thanks, but your answer in ALL CAPS was not very useful in explaining why my ELSEIF is failing.

You need to be a little nicer in online forums. ALL CAPS is considered yelling at someone.

Exactly that is why I used all caps. Because I wanted to get it across to you that you need to indent your code.
I’m NOT going to dissect your code when its all bunched up together like it is.

You will? Cool. I will be awaiting your reply.

Re-read you caught me in the middle of editing.

Indenting your code will help you to discover where the problem is occurring and why. The purpose of indenting is to help you as a programmer to find these simple mistakes in your code structure.

Once you indent your code appropriately, you will see that the problem and the solution becomes very clear indeed.