views:

27

answers:

0

Hi guys, I am trying to post a message to a users facebook wall using FBJS or the PHP SDK, the problem I have is that I authenticate the user on the index.php page, but a flash program is calling my post_to_wall.php script which should update the users wall, but this is not working, here is the code,

require "facebook-php-sdk/src/facebook.php";

    //I get these variables from Flash
    $userID = $_POST['userID'];
    $token = $_POST['token'];

             $facebook->api('/'.$userID.'/feed', 'POST', array(  
                'access_token' => $token,
                'message' => 'The message',  
                'name' => 'The name',  
                'description' => 'The description',  
                'caption' => 'The caption',  
                'picture' => 'http://my.site.com/test.jpg',  
                'link' => 'http://my.site.com/'  
             ));

Basically it is calling "post_to_wall.php" when the user clicks on the "Post" button on the flash file, I know FBJS is the way to go, but I have NO idea on how to proceed.

I might be able to go home tonight if I get this sorted, so thanx in advance to anyone who helps out!