Tom Granot-Scalosub Tom Granot-Scalosub - 1 year ago 74
PHP Question

Publish Feed To Facebook Jams Up PHP

I'm using the php SDK for the Graph API, and everything is working fine-getting usernames, uploading photos etc.
However, when I'm trying to publish to the current user's feed, it just makes the page get stuck.

This is the code:

$publish_feed = $facebook->api('/'.$userid'/feed', 'post', array(
'message'=> 'message',
'picture'=> '',
'link'=> ''

I've tried:

  1. Putting the code in different places in the code-no matter where I do, it gets the page stuck, Even if ti is at the end of the code, it gets it stuck, and nothing shows.

  2. changing
    . No success.

Please help.

Answer Source
  1. Make sure you have the publish_stream permission
  2. use /me or api("/$userid/feed",..etc
  3. Remove the extra column:


$params =   array(
                'message' => 'message',
                'picture'=> '',
                'link'=> ''
$publish_feed = $facebook->api("/$userid/feed", "post", $params);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download