i made this function: function Online ( ) { define('IN_PHPBB', TRUE); $phpbb_root_path = 'forum/'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.'.$phpEx); // // Start session management // $userdata = session_pagestart ( $user_ip, PAGE_INDEX ); init_userprefs ( $userdata ); // // End session management // if( $userdata['session_logged_in'] ) { return TRUE; } else { return FALSE; } } and called it like: if ( $Func->Online ( ) ) { echo 'boo!'; } but i get this error: Fatal error: Call to a member function on a non-object in /home/luke06/public_html/forum/includes/sessions.php on line 134 but the code out side of a function works perfect. Any ideas