Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to show login user name in php

<li class='active' style='float:right;'>
  <?php 
  session_start();
    if($_SESSION['logged']==true){ 
        echo $_SESSION["username"];
        echo '<a href="logout.php"><span>Logout</span></a></li>';
        }
    elseif($_SESSION['logged']==false) 
        echo '<a href="registerform.html"><span>Login/Register</span></a></li>';
    ?>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #show #login #user #php
ADD COMMENT
Topic
Name
2+3 =