ZEESHAN IQBAL
ZEESHAN IQBAL

Reputation: 273

How to post on directly users wall in Facebook

I use this to post on users wall, but it shows a blank page, and the post doesn't appear on my wall :

$url = "https://graph.facebook.com/user_id/feed";
$ch = curl_init();
$attachment =  array(   'access_token'  => access_token_here,                        
                    'name'          => "Rave Kenya",
                    'link'          => "www.youtube.com",
                    'description'   => 'Testing a new facebook app',
                    'message' => 'Tested',

                );

curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment);
$result =curl_exec($ch);

Upvotes: 0

Views: 1001

Answers (1)

Janis Veinbergs
Janis Veinbergs

Reputation: 6988

Why reinvent the wheel and not use facebook php library?

And a step-by-step instructions are available at "5 Steps to publish on a facebook wall using php"

Upvotes: 2

Related Questions