Insert "Logged in as "member"" on an html page

Discussion in 'aMember Pro v.4' started by justified1103, May 25, 2012.

  1. justified1103

    justified1103 New Member

    Joined:
    Apr 20, 2012
    Messages:
    3
    Hi there.

    I read in another thread that its possible to add log out and profile links to an html page.

    Is it possible to insert "Logged in as "member" on a html page like it is on the /amember/member page :)

    regards

    Justin
  2. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
  3. justified1103

    justified1103 New Member

    Joined:
    Apr 20, 2012
    Messages:
    3
    Hi David,

    Thanks so much for the reply, I'm not as experienced with PHP as I would like to be, what code will I insert onto my page?

    Kind regards

    Justin
  4. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    You can't insert such code to html page. Only to php.
    Place this somewhere at the top of your php file:
    <?php require_once '/home/myusername/public_html/amember/library/Am/Lite.php'; ?>
    Then use this code to display login:
    Logged in as <?php echo Am_Lite::getInstance()->getUsername(); ?>

Share This Page