Jump to content

undefined method problem


SkyRanger

Recommended Posts

I am having a problem with a session:

 

This is the error I am getting:

Fatal error: Call to undefined method Session::isFounder() in membersfiles.php on line 20

 

Here is Lines 20 - 27

 

if($session->isFounder()){
echo "Link1<br>";
echo "Link2<br>";
echo " Link3";
}

if($session->isAdmin()){
      echo "  [<a class=\"newmsg\" href=\"admin/admin.php\">Admin Center</a>]";
   }   

The isAdmin works fine if I remove isFounder

This is where it called from:

sessions.php

function isAdmin(){
      return ($this->userlevel == ADMIN_LEVEL ||
              $this->username  == ADMIN_NAME);
   }
   
   function isFounder(){
      return ($this->userlevel == OFFICE_LEVEL ||
          $this->username == OFFICE_NAME);
}

and

constants.php

define("ADMIN_NAME", "Admin");
define("GUEST_NAME", "Guest");
define("OFFICE_NAME", "Founders");
define("ADMIN_LEVEL", 9);
define("OFFICE_LEVEL", 4);
define("USER_LEVEL",  1);
define("GUEST_LEVEL", 0);

Link to comment
https://forums.phpfreaks.com/topic/48678-undefined-method-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.