<?php if(isset($_SESSION['id'])){ ?> <a class="link" href="logout.php" style="text-decoration:none">logout</a> <?php }else{ ?> <a class="link" href="login.php" style="text-decoration:none">login</a> <?php } ?>