azunoman Posted September 21, 2006 Share Posted September 21, 2006 I created a template, which is used by each page in my site for consistency. page1 page2 page3 etc.Each page has a common class call that will check if the user is logged on etc. It provides links depending on the status of the user. The links are fine on the initial page but for each subsequent page the links will be www.mysite.com/login/login/register.php. It just keeps adding the /login/ folder....argh[code]echo "Welcome"."[<a href=\"login/login.php\">Sign In</a>]"." "."[<a href=\"login/register.php\">Register</a>]"." ";[/code]There has to be a better method. What says the forum?Thanks in advance for your time.HERE IS THE CLASS CODE I WROTE, USED BY EACH AND EVERY PAGE.[code]<?// DisplaySignOnStatus.php// Called to display signon status// require_once $_SERVER['DOCUMENT_ROOT']."/login/include/session.php";//////class DisplaySignOnStatus { function DisplaySignOnStatus(){ global $session; /* Check if user logged_in */ if($session->logged_in){ echo "Hello <b>$session->username</b>! "."[<a href=\"login/process.php\">Logout</a>]"." "."[<a href=\"login/userinfo.php?user=$session->username\">My Account</a>] "; if($session->isAdmin()){ echo "[<a href=\"login/admin/admin.php\">Admin Center</a>] "; } } // //user is not logged on // else{ echo "Welcome"."[<a href=\"login/login.php\">Sign In</a>]"." "."[<a href=\"login/register.php\">Register</a>]"." "; } } //end method}; //class /* Initialize process */$signstatus = new DisplaySignOnStatus;?>[/code] Quote Link to comment Share on other sites More sharing options...
azunoman Posted September 21, 2006 Author Share Posted September 21, 2006 This was simply resolved by placing a / in front of the folder name...ie. /login/some.phpsorry Quote Link to comment 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.