Displaying Username in my php header files

Discussion in 'aMember Pro v.4' started by joemartini22, Apr 2, 2012.

  1. joemartini22

    joemartini22 New Member

    Joined:
    Mar 13, 2012
    Messages:
    1
    I created a file using the following code:

    Code:
    <?php
    require_once '/home/fgleague/public_html/amember/library/Am/Lite.php';
    echo Am_Lite::getInstance()->getUsername();
    ?>
    and it is returning the logged in user's username perfectly. However I cannot get this code to work in my other files, mainly my header php file that I am using on all of my pages. Any idea why? I have tried moving the code all around but cannot seem to get the username to display.

    Thanks.
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Please insert this code somewhere in your header.php file :
    phpinfo(); and attach output. You can do this in helpdesk if don't want to attach it in public forum.

Share This Page