PHP – Facebook API ( Invalid OAuth access token signature )

apiauthenticationfacebookPHPsdk

i'm trying use facebook API to upload photo in my fan page. I downloaded that code ready to do it ( https://www.box.com/s/a116a94bff8cb2a46634 ) . Its working good, but, when i edit and put my settings to upload the photo, i have this error…

Notice: Undefined variable: fanpage_token in /home/sistemasfox/www/enc/face/uploadtopage.php on line 101
Fatal error: Uncaught OAuthException: Invalid OAuth access token signature. thrown in /home/sistemasfox/www/enc/face/library/facebook.php on line 543

Page ID: 239132959534036 / Album ID: 241768162603849

I copied the token from here : face book.com/tools/access_token/

I'm doing tests here: http://sistemasfox.com.br/enc/face/uploadtopage.php

Is necessary to make some configuration specified in the facebook application?

Thank you.

Best Answer

Copy and paste line 63 of uploadtopage.php, and after pasting, change the variable from $access_token to $fanpage_token

See if that works?

i.e.:

$access_token = 'AAAAARH40cT0BANFh5V7Cn8dlXciZCbonSmGQZCeX3kUKIx2OMmvrqKUsHIBBj6bYi2vV25lMj6ZA5UDOaJpAxJXBEMOjZAcZD';

$fanpage_token = 'AAAAARH40cT0BANFh5V7Cn8dlXciZCbonSmGQZCeX3kUKIx2OMmvrqKUsHIBBj6bYi2vV25lMj6ZA5UDOaJpAxJXBEMOjZAcZD';