"Call to undefined method" in my Facebook application

Posted by Robert on Stack Overflow See other posts from Stack Overflow or by Robert
Published on 2010-05-10T01:36:56Z Indexed on 2010/05/10 1:48 UTC
Read the original article Hit count: 1010

Filed under:

I have written my first php script to learn facebook API stuff. It goes like this:

<?php  
require_once('facebook/client/facebook.php');

$facebook = new Facebook(
                  '0fff13540b7ff2ae94be38463cb4fa67',
                  '8a029798dd463be6c94cb8d9ca851696');
http://stackoverflow.com/questions/ask  
$fb_user = $facebook->require_login();    
?>

Hello <fb:name uid='<?php echo $fb_user; ?>' useyou='false' possessive='true' />!
Welcome to my first application!

I put "facebook.php" in the same directory as my php script.

However, after I deploy the php on a web server and link it with facebook and run it, I get an error saying:

"Fatal error: Call to undefined method Facebook::require_login() in /home/a2660104/public_html/facebook-php-sdk-94fcb13/src/default.php on line 16"

Could anyone help me a bit on this? I am a beginner to the facebook app programming.

© Stack Overflow or respective owner

Related posts about facebook-application