new to php. My echoed url is appending itself to the current
Posted: Sun Oct 02, 2011 7:02 pm
I am a php beginner, hence my first post here. So hello people.
I have written the following code (for a wordpress page)
The idea is it adds a link to a page which takes me to another page
The code works fine when I am on my main page logged in as a user. ie http://www.mywebsite/
and when I click the link I get http://www.mywebsite/user1/anotherdirectory
When I move to another page like http://www.mywebsite/anotherpage.html - the echoed url from my link appends itself to the current url in the browser so I get
http://www.mywebsite/anotheruserspage.h ... directory/
My question is how do I stop it appending the url?
I have written the following code (for a wordpress page)
The idea is it adds a link to a page which takes me to another page
The code works fine when I am on my main page logged in as a user. ie http://www.mywebsite/
and when I click the link I get http://www.mywebsite/user1/anotherdirectory
When I move to another page like http://www.mywebsite/anotherpage.html - the echoed url from my link appends itself to the current url in the browser so I get
http://www.mywebsite/anotheruserspage.h ... directory/
My question is how do I stop it appending the url?
Code: Select all
<?php global $user_login;
get_currentuserinfo();
echo"<a href=\"$BASE_URL$user_login/anotherdirectory/\">dash</a>";
?>