views:

39

answers:

0

Hi. I am following the tutorial here

First I have a iframe like this:

<iframe src ="http://www.facebook.com/login.php?api_key=XXXXXXXXXXX&amp;connect_display=popup&amp;v=1.0&amp;next=http://www.facebook.com/connect/login_success.html&amp;cancel_url=http://www.facebook.com/connect/login_failure.html&amp;fbconnect=true&amp;return_session=true&amp;req_perms=read_stream,publish_stream,offline_access" width="80%" height="140px">
          <p>Your browser does not support iframes.</p>
    </iframe>

This shows only "success" when a user has authorized my application. I would like to check this with php, but have no idea how I would do that.

After this I have this code:

$fb = new Facebook(array(
  'appId'  => 'XXX',
  'secret' => 'XXX',
  'cookie' => true, // enable optional cookie support
));

$testtoken= "XXXX"; // Replace this value with your Token Value
$result = $fb->call_method('facebook.auth.getSession',  array('auth_token' => $testtoken, 'generate_session_secret' => true));
//Here I get Fatal error: Call to undefined method Facebook::call_method()

echo "<br /> <pre>";

print_r($result);

echo $session_key = $result['session_key'];

I have included the facebook.php in my code. I don't know what more I can do do define the function.. What I want to do is just to publish a message and a link on users facebook wall, but I also would really like to register if this is done successfully so I can register the number of post on users wall in my database for every user.