MyCollegeFM Posted January 24, 2012 Share Posted January 24, 2012 I am having trouble figuring this out myself, so hopefully someone can help me out. What I am trying to do is write a code to link an image to a logged in users "edit profile" page. Right now, the page address the image needs to be linked to would be: "MyCollegeFleaMarket.com/users/Username" Currently, the code I have in place is this: "users/<?php global $user; if ($user->uid) { print $user->name; } ?>"> but this is creating a link to, "MyCollegeFleaMarket.com/content/users/Username. Thanks for your help! Quote Link to comment https://forums.phpfreaks.com/topic/255680-code-request-link-to-users-profile/ Share on other sites More sharing options...
premiso Posted January 24, 2012 Share Posted January 24, 2012 Althought I do shutter at doing a global inline with the code like you did, this should fix it: "/users/<?php global $user; if ($user->uid) { print $user->name; } ?>"> The problem was that without the initial slash, it becomes relative to the page you are on, and thus the content is added. With the initial slash added it will be relative to the root. Quote Link to comment https://forums.phpfreaks.com/topic/255680-code-request-link-to-users-profile/#findComment-1310660 Share on other sites More sharing options...
MyCollegeFM Posted January 24, 2012 Author Share Posted January 24, 2012 Thank you so much! I can't believe it was that simple. Thanks again! Quote Link to comment https://forums.phpfreaks.com/topic/255680-code-request-link-to-users-profile/#findComment-1310691 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.