Far Cry Posted June 4, 2010 Share Posted June 4, 2010 Fatal error: Call to undefined method Session::ismod() in /home/a1535619/public_html/main.php on line 38 ."[<a href=\"userinfo.php?user=$session->username\">My Account</a>] " ."[<a href=\"useredit.php\">Edit Account</a>] "; if($session->isAdmin()){ echo "[<a href=\"admin.php\">Admin Center</a>] "; } if($session->ismod()){ echo "[<a href=\"mod.php\">Mod Center</a>] "; } echo "[<a href=\"process.php\">Logout</a>]"; } else{ ?> I got the error after I inserted : f($session->ismod()){ echo "[<a href=\"mod.php\">Mod Center</a>] "; Can someone help Link to comment https://forums.phpfreaks.com/topic/203911-undidefined-method-help/ Share on other sites More sharing options...
dabaR Posted June 4, 2010 Share Posted June 4, 2010 Your exclamation point button seems to be stuck. Can you post the code that defines the class that $session is an object of? Link to comment https://forums.phpfreaks.com/topic/203911-undidefined-method-help/#findComment-1067970 Share on other sites More sharing options...
Far Cry Posted June 4, 2010 Author Share Posted June 4, 2010 define("ADMIN_NAME", "admin"); define("GUEST_NAME", "Guest"); define("ADMIN_LEVEL", 3); define("USER_LEVEL", 1); define("GUEST_LEVEL", 0); define("MOD_NAME", "mod"); define("MOD_LEVEL", 2); Link to comment https://forums.phpfreaks.com/topic/203911-undidefined-method-help/#findComment-1067976 Share on other sites More sharing options...
Alex Posted June 4, 2010 Share Posted June 4, 2010 That's just a bunch of defined constants, it's not the session class definition. It should look something like.. class session{ ... } Link to comment https://forums.phpfreaks.com/topic/203911-undidefined-method-help/#findComment-1067978 Share on other sites More sharing options...
Far Cry Posted June 5, 2010 Author Share Posted June 5, 2010 class Session { var $username; //Username given on sign-up var $userid; //Random value generated on current login var $userlevel; //The level to which the user pertains var $time; //Time user was last active (page loaded) var $logged_in; //True if user is logged in, false otherwise var $userinfo = array(); //The array holding all user info var $url; //The page url current being viewed var $referrer; //Last recorded site page viewed Link to comment https://forums.phpfreaks.com/topic/203911-undidefined-method-help/#findComment-1068054 Share on other sites More sharing options...
dabaR Posted June 5, 2010 Share Posted June 5, 2010 Whole class, please. Link to comment https://forums.phpfreaks.com/topic/203911-undidefined-method-help/#findComment-1068056 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.