What code do I put into a php page to get the same effect as on the amember.com website, in the upper right corner. When a user isn't logged in it says: 'Already a member? Sign in' If the user is signed in, user sees 'My Account | Sign Out'. This issue was not solved in the thread link belowhttp://www.amember.com/forum/threads/sign-in-my-account.14319/#post-55292
I thought example was already in that thread? PHP: include "amember/library/Am/Lite.php"$lite = Am_Lite::getInstance();if($lite->isLoggedIn()){ print "My Account | Sign Out";}else{ print "Already a member? Sign in";}
How do include this code in my page? i tried to add this in the body of the page, but it doesn't work. Am i doing something wrong PHP: <?phpinclude "amember/library/Am/Lite.php" $lite = Am_Lite::getInstance(); if($lite->isLoggedIn()){ print "My Account | Sign Out";}else{ print "Already a member? Sign in";}?>
Yes i did, but it gives the following error when i tried to access it Parse error: syntax error, unexpected T_VARIABLE in /public_html/1.php on line 4
ok i made it work finally. so this the code, for those whom it my help with the same problem this code works, i tested it. don't forget to put it in a PHP file PHP: <?php include "amember/library/Am/Lite.php"; $lite = Am_Lite::getInstance(); if($lite->isLoggedIn()){ Echo '<a href="amember/member">My Account</a>'; Echo ' | '; Echo '<a href="amember/logout">Sign Out</a>';}else{ Echo 'Already a member? <a href="amember/login">Sign In</a>';}?>