Jump to content

Recommended Posts

I know nothing of PHP coding and have bought a php membership program called aMember.  All I am trying to do is get each member's name to display on the top of each page.  The company says they use something called Am Lite in conjunction with their php code to call up the member name.  they gave me the folling instructions:

 

Here is example of usage

<?php // it should be first line on your page require_once '/home/myusername/public_html/amember/library/Am/Lite.php'; ?> 

...your code...

<?php if (Am_Lite::getInstance()->isLoggedIn()) : ?> Welcome <?= htmlspecialchars(Am_Lite::getInstance()->getName()  ) ?>!
<?php endif; ?>

....your code...

I have tried various variations of arranging the code on a php page - see attached - and nothing seems to work.  I get the following errors:

 

Warning: require_once(/public_html/amember/library/Am/Lite.php): failed to open stream: No such file or directory in /home/tradeco/public_html/ts_main_1920/login_name_test.php on line 5

Fatal error: require_once(): Failed opening required '/public_html/amember/library/Am/Lite.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/tradeco/public_html/ts_main_1920/login_name_test.php on line 5

 

Any help and or guidance would be greatly appreciated.

 

Thanks in advance

Luke

 

 

login_name_test.php

Link to comment
https://forums.phpfreaks.com/topic/288023-am-lite-pulling-up-username/
Share on other sites

I think the message should be clear to anybody who uses a computer: The file you're trying to include does not exist (or at least it can't be read).

 

Are you sure you got the path right? You're claiming the library script is in this folder:

/public_html/amember/library/Am/

Is it? I highly doubt that you have a folder called “public_html” in the root directory.

 

Also, your own script is under this folder:

/home/tradeco/public_html/

That's a very different “public_html”. I think you actually want this one.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.