title: How to change login and logout links dynamically in HTML page in PHP?
body: <p>I have the following HTML code. I have 2 php files: login.php and logout.php. When any user first comes to my page, I would like him to see the login link. After clicking log in (which I will process with my login.php file) I want to change that login link to logout (and on click of that logout.php file will be processed)</p>
  
  <p>In the following code, how could I dynamically change login and logout links? Currently I have given 2 different links for login and logout which is not a good idea.</p>
  
  <pre><code>&lt;header class="group"&gt;
      &lt;nav class="group"&gt;         
          &lt;ul&gt;
            &lt;li&gt;&lt;a href="register.php" title=""&gt;Register&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="login.php" title=""&gt;Login&lt;/a&gt;&lt;/li&gt;   
                &lt;li&gt;&lt;a href="logout.php" title=""&gt;Logout&lt;/a&gt;&lt;/li&gt;             
          &lt;/ul&gt;
      &lt;/nav&gt;
  &lt;/header&gt;
  </code></pre>