title: How to I fix this if/else tree? PHP
body: <p>I am trying to program a sub-system for students on my website, I tried using these if/else statements  to determine some outputs if the parameters match with the user information they have. So if a user is  a student they can contact other people that are students and cant contact other users that are not students, and vice versa. The code I tried is below. The problem is that the code shows the error message and the message buttons at the same time whether or not the user is or is not a student. TIP: This PHP code is in a .phtml file, hence the amount of PHP opening and closing tags.</p>
  
  <pre><code>&lt;?php if($dc['user']['student'] !== 0){ ?&gt;
      &lt;?php if(Dc_IsStudent($dc['popover']['user_id']) == true){ ?&gt;
          &lt;div class="user-button user-follow-button"&gt;&lt;?php echo Dc_GetFollowButton($dc['popover']['user_id']); ?&gt;&lt;/div&gt;
          &lt;div class="user-button message-button"&gt;&lt;?php echo Dc_GetMessageButton($dc['popover']['user_id']); ?&gt;&lt;/div&gt;
      &lt;?php } ?&gt;
  
      &lt;?php if(Dc_IsStudent($dc['popover']['user_id']) == false) { ?&gt;
          &lt;?php echo $dc['lang']['student_contact_warning'];  ?&gt; 
      &lt;?php } ?&gt;
  &lt;?php } ?&gt;
  
  &lt;?php if($dc['user']['student'] !== 1){ ?&gt;
      &lt;?php if(Dc_IsStudent($dc['popover']['user_id']) == false){ ?&gt;
          &lt;div class="user-button user-follow-button"&gt;&lt;?php echo Dc_GetFollowButton($dc['popover']['user_id']); ?&gt;&lt;/div&gt;
          &lt;div class="user-button message-button"&gt;&lt;?php echo Dc_GetMessageButton($dc['popover']['user_id']); ?&gt;&lt;/div&gt;
      &lt;?php } ?&gt;
  
      &lt;?php if(Dc_IsStudent($dc['popover']['user_id']) == true) { ?&gt;
          &lt;?php echo $dc['lang']['student_contact_warning'];  ?&gt; 
      &lt;?php } ?&gt;
  &lt;?php } ?&gt;
  </code></pre>