Reputation: 7463
I am following the instructions on this page to create a PHP script which will (hopefully) allow me to post to Facebook from my web site.
All I really want to establish is the ability to enter text and a link into a form on my web site and have it be posted to a Facebook wall.
My understanding is that I need to validate a Facebook app in order to do this, which is what brought me to the above web page.
I have followed their instructions dutifully, and by now I have been through it many times, checking to make sure I have followed their steps accurately.
However, when it gets to the part where I run fb_access.php from my web site, I get absolutely no response from Facebook.
I notice that the screen shot examples on the page I am using are not what I am seeing in the Facebook interface. The tutorial is from December 2010, which I would hope is recent enough, but perhaps things have changed...?
How do I get Facebook to respond to my PHP script?
<?
require_once 'facebook.php';
$app_id = "<my App ID";
$app_secret = "<my App Secret>";
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $app_secret,
'cookie' => true
));
if(is_null($facebook->getUser()))
{
header("Location:{$facebook->getLoginUrl(array('req_perms' => 'user_status,publish_stream,user_photos'))}");
exit;
}
?>
Upvotes: 0
Views: 70
Reputation: 4186
Try using the Facebook PHP SDK demo script here:
https://github.com/facebook/php-sdk/blob/master/examples/example.php
Once you have this script running - you can then begin to request calls, such as post to wall. If the call is successful, FB will prompt you with a Request for Permission.
Upvotes: 1