SkyRanger Posted April 25, 2007 Share Posted April 25, 2007 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); Quote Link to comment https://forums.phpfreaks.com/topic/48678-undefined-method-problem/ Share on other sites More sharing options...
SkyRanger Posted April 25, 2007 Author Share Posted April 25, 2007 ~bump~ Quote Link to comment https://forums.phpfreaks.com/topic/48678-undefined-method-problem/#findComment-238475 Share on other sites More sharing options...
marmite Posted April 25, 2007 Share Posted April 25, 2007 I'm quite new so sorry if this is a silly suggestion. But could it be that you haven't "required" sessions.php? It's not finding the function im memberfiles.php... so perhaps the link between memberfiles and sessions isn't working? Quote Link to comment https://forums.phpfreaks.com/topic/48678-undefined-method-problem/#findComment-238479 Share on other sites More sharing options...
SkyRanger Posted April 25, 2007 Author Share Posted April 25, 2007 Yeah, it calls it no problem. as noted before the isAdmin function is working no problem, not sure why the isFounders is not working. Quote Link to comment https://forums.phpfreaks.com/topic/48678-undefined-method-problem/#findComment-238494 Share on other sites More sharing options...
MadTechie Posted April 25, 2007 Share Posted April 25, 2007 isFounder() function isn't in the class defined as $session Quote Link to comment https://forums.phpfreaks.com/topic/48678-undefined-method-problem/#findComment-238519 Share on other sites More sharing options...
SkyRanger Posted April 25, 2007 Author Share Posted April 25, 2007 D'oh I was starting to go through the session variables and just noticed. Thanks MadTechie. Just have to figure out how I can do what I need another way. Quote Link to comment https://forums.phpfreaks.com/topic/48678-undefined-method-problem/#findComment-238580 Share on other sites More sharing options...
MadTechie Posted April 25, 2007 Share Posted April 25, 2007 from the script supplied i can't see what your trying to do, please explain Quote Link to comment https://forums.phpfreaks.com/topic/48678-undefined-method-problem/#findComment-238597 Share on other sites More sharing options...
SkyRanger Posted April 25, 2007 Author Share Posted April 25, 2007 Right now with the isAdmin Session read from the sessions.php file allows me to list links only for Admin. I am trying to figure out a way to only show links for Founders also Quote Link to comment https://forums.phpfreaks.com/topic/48678-undefined-method-problem/#findComment-238604 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.