I don't understand. You're sending a text link. If you want to use an image do it the same way everyone else does and include an img between the anchor tags.
On the subject of this thread, I've had to remove all the session_start additions because of various conflicts I've had. It was just easier not including status on pages because of the conflicts so I removed them. Not happy about it but my coders were having a difficult time with some encoded files, not necessarily amember which is also partially encoded.
Replace: Code: <a href='/logout.php'>Logout</a> <a href='https://sitename.com/login.php'>Login</a> With: Code: <a href='/logout.php'><img src='url' /></a> <a href='https://sitename.com/login.php'><img src='url' /></a> 'url' = the location of the image you want to use. For example, http://www.sitename.com/images/loginimg.jpg renee
Yeah, you have to close the img tag. Technically, the tag is <img src="url"></img>, but you can shorten it by adding the slash before the opening tag’s right bracket.
Avortelinc, If you wish to use images for the login / logout links, you may use the following: PHP: <?phpif ($au=$_SESSION['_amember_user']){ // user is logged-inprint "<a href='/logout.php'><img src='http://path_to_image_here_for_logout' /></a>";} else { // user is not logged-inprint "<a href='https://sitename.com/login.php'><img src='http://path_to_image_here_for_login' /></a>";}?> If you take a step back and look at the PRINT statements, the values enclosed in the quotations (") is simple html and as such follows the standards set by W3C for writing html code if you wish to alter.
The script is working fine and many thanks, but after web server migration, the script can only display and ask user to login again even if user has log in already. I contact web hosting admin to check PHP configuration and everything is the same I got. If anybody know what's happening? The script I use is as follow. <?php session_start(); if ($au=$_SESSION['_amember_user']){ // user is logged-in print "Hello $au[name_f] $au[name_l]!<br>"; print "<a href='/amember/logout.php'>Logout</a>"; } else { // user is not logged-in print "<form method=post action='/amember/login.php'> Username: <input type=text name=amember_login size=10><br> Password: <input type=password name=amember_pass size=10><br> <input type=submit value='Login'> </form>"; } ? >
Place phpinfo(); in your login script after session_start(); line. Save phpinfo output then compare it with aMember CP -> Version Info (you need to check sessions section) Alls settings should be the same exactly, if something is different, that is the reason why login form does not work.
There are two values in sessions section, Local and Master. I found session.bug_compat_warn is OFF in Local Value and ON in Master Value in aMember->Version Info, but both are ON in phpinfo. all others are exactly the same. Do you think there is the reason? Thanks alot.
No this can't be because of session.bug_compat_warn Please contact us in helpdesk and provide access info, we will check what can be wrong.
Hello, Ok, now that I am using the following code with v3 : <?php if ($au=$_SESSION['_amember_user']){ // user is logged-in print "<a href='/logout.php'>Logout</a>"; } else { // user is not logged-in print "<a href='https://sitename.com/login.php'>Login</a>"; } ?> What would be the code for v4?!
I am also new to this and lost through the entire PHP code. What code do I have to use so it can print the "login" link on every page? If the user is logged in then the "login" link will be replaced with the "logout" link. I also want to have print "My Account" so the user can go to his account and make any changes. How I can do all this? Thank you
It does not work. I have this error: Parse error: syntax error, unexpected T_VARIABLE in /hermes/web05/b2910/moo.signingpediacom/fable3.php on line 4 Code: <?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"; } ?> Something does not work with this code. I changed it to: Code: <?php require_once '/hermes/web05/b2910/moo.signingpediacom/amember/library/Am/Lite.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"; } ?> But I still have the same error. I also removed the include "amember/library/Am/Lite.php" line. Still can't make it to work.
Semicolon added and now the Code: "Already a member? Sign in" appears. I am wondering wy it's on the left side of the page. I thought it will be added automatically in the menu bar and on the right upper side. Moreover, if I am signed in, instead of this, I should see Code: My Account | Sign Out but I still see the same line (Already a member / Sign in). I don't know what else to do to make it work.
It appears where you put that code. Contact us in helpdesk and provide access info to file where you have that code and explain how did you test this.