Jump to content


Photo

links getting extraneous link information using templates


  • Please log in to reply
1 reply to this topic

#1 azunoman

azunoman
  • Members
  • PipPipPip
  • Advanced Member
  • 43 posts

Posted 21 September 2006 - 08:04 PM

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


echo "Welcome"."[<a href=\"login/login.php\">Sign In</a>]"."&nbsp;&nbsp;"."[<a href=\"login/register.php\">Register</a>]"."&nbsp;&nbsp;";

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.
<?
// 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>!&nbsp;&nbsp;"."[<a href=\"login/process.php\">Logout</a>]"."&nbsp;&nbsp;"
."[<a href=\"login/userinfo.php?user=$session->username\">My Account</a>] &nbsp;&nbsp;";

			if($session->isAdmin()){
			echo "[<a href=\"login/admin/admin.php\">Admin Center</a>] &nbsp;&nbsp;";
			}
		}
		//
		//user is not logged on
		//
		else{
		echo "Welcome"."[<a href=\"login/login.php\">Sign In</a>]"."&nbsp;&nbsp;"."[<a href=\"login/register.php\">Register</a>]"."&nbsp;&nbsp;";
		}
	}	//end method
}; //class
	
/* Initialize process */
$signstatus = new DisplaySignOnStatus;
?>



#2 azunoman

azunoman
  • Members
  • PipPipPip
  • Advanced Member
  • 43 posts

Posted 21 September 2006 - 08:51 PM

This was simply resolved by placing a / in front of the folder name...ie.  /login/some.php

sorry




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users