title: Cannot display a certain pic for an admin and a simple user in a chat app
body: <p>Trying to display a different pic for the logged in user if it's an admin or a simple user. Here is my function </p>
  
  <pre><code>function isAdminPhotoChange() {
      // check if user is admin or user
      if (isset($_SESSION['user']) &amp;&amp; $_SESSION['user']['user_type'] == 'admin') {
          if (file_exists("images/metcircle13.png")) {
              $filename = "$metcircle13.png";
              echo '&lt;img src="images/&lt;?php echo'. $filename.'?&gt;" style="height: 50px;"&gt;';
          } else {
              if (isset($_SESSION['user']) &amp;&amp; $_SESSION['user']['user_type'] == 'user') {
                  $filename = "user_profile.jpg";
                  echo '&lt;img src="images/&lt;?php echo'. $filename.'?&gt;" style="height: 50px;"&gt;';
              }
          }
      }
  }
  </code></pre>
  
  <p>And here is the call in another php file</p>
  
  <pre><code>&lt;?php
  include("functions.php");
  
  $comm = mysqli_query($db, "select name,comment,post_time from comments");
  while($row=mysqli_fetch_array($comm)){
  
      $name=$row['name'];
      $comment=$row['comment'];
      $time=$row['post_time'];
  }
  
  ?&gt;
  &lt;div class="sxolion"&gt;
  &lt;strong style="margin: 3px; color: #000; text-shadow: 2px 2px 5px #3d5c5c;"&gt;&lt;?php isAdminPhotoChange(); ?&gt;&lt;br&gt;&lt;p style="margin: 4px;"&gt;&lt;?=$name?&gt;&lt;/p&gt;&lt;/strong&gt;&lt;p style="margin: 3px;"&gt;&lt;?=$comment?&gt;&lt;/p&gt;&lt;span class="time"&gt;&lt;br&gt;&lt;p style="margin: 4px;"&gt;&lt;?=date("j/m/Y g:i:sa", strtotime($time))?&gt;&lt;/p&gt;&lt;/span&gt;
  </code></pre>
  
  <p></p>
  
  <p>Thank You!</p>