title: Change navbar after user login php
body: <p>I want the "Login/Sign up" button in the navigation bar to change to "My Account" after the user logs in.</p>
  
  <p>The navigation.php file I use for this currently looks like this:</p>
  
  <pre><code>&lt;?php 
      session_start();
      include("check.php");   
  ?&gt;
  
  
  &lt;?php 
  
  if ($_SESSION['username']){ ?&gt;
      &lt;div id="nav"&gt;
          &lt;ul &gt;
              &lt;li class="navbar-left"&gt;&lt;a href="artikelen.html"&gt;Men&lt;/a&gt;&lt;/li&gt;
              &lt;li class="navbar-left"&gt;&lt;a href="artikelen.html"&gt;Women&lt;/a&gt;&lt;/li&gt;
              &lt;li class="navbar-left"&gt;&lt;a href="artikelen.html"&gt;Kids&lt;/a&gt;&lt;/li&gt;
              &lt;li class="navbar-right"&gt;&lt;a href="view_cart.php"&gt;Cart (0)&lt;/a&gt;&lt;/li&gt;
              &lt;li class="navbar-right"&gt;&lt;a href="inlog.php"&gt;My Account&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
      &lt;/div&gt;
  
  &lt;?php } else { ?&gt;
      &lt;div id="nav"&gt;
          &lt;ul &gt;
              &lt;li class="navbar-left"&gt;&lt;a href="artikelen.html"&gt;Men&lt;/a&gt;&lt;/li&gt;
              &lt;li class="navbar-left"&gt;&lt;a href="artikelen.html"&gt;Women&lt;/a&gt;&lt;/li&gt;
              &lt;li class="navbar-left"&gt;&lt;a href="artikelen.html"&gt;Kids&lt;/a&gt;&lt;/li&gt;
              &lt;li class="navbar-right"&gt;&lt;a href="view_cart.php"&gt;Cart (0)&lt;/a&gt;&lt;/li&gt;
              &lt;li class="navbar-right"&gt;&lt;a href="inlog.php"&gt;Login / Sign Up&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
      &lt;/div&gt; 
  &lt;?php }
  ?&gt;
  </code></pre>
  
  <p>The check.php file looks like this:</p>
  
  <pre><code>&lt;?php
  include('connection.php');
  session_start();
  $user_check=$_SESSION['username'];
  
  $ses_sql = mysqli_query($db,"SELECT username FROM users WHERE username='$user_check' ");
  
  $row=mysqli_fetch_array($ses_sql,MYSQLI_ASSOC);
  
  $login_user=$row['username'];
  
  if(!isset($user_check))
  {
  header("Location: index.php");
  }
  ?&gt;
  </code></pre>
  
  <p>If I go to a webpage with this navigation bar I get the following error:</p>
  
  <blockquote>
    <p>This webpage has a redirect loop ERR_TOO_MANY_REDIRECTS</p>
  </blockquote>
  
  <p>Can someone please help me?</p>