subhomoy Posted November 19, 2015 Share Posted November 19, 2015 (edited) Hello everybody I;m trying to post data to my facbook page (not on my profile wall) but whenever i try it keeps getting posted in my fan page but in different place . I want to post it using My Page name i the wall but it is getting posted in this section (in the left panel of my page..) I want to show in the page wall like all the posts is showing... Here is the script that i've used $touid = "xxxxxxxxxxxxxxxxx"; // This is the page id i'm using $token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // my access token of that page $msg = "Hello again"; $title = "TItle"; $uri = "http://www.google.com"; $desc = "description"; $pic = "http://i.imgur.com/JCdGh.png"; $action_name = "Google"; $action_link = "http://www.google.com"; echo FB_wallpost_wosdk($touid, $token, $msg, $title, $uri, $desc, $pic, $action_name, $action_link); function FB_wallpost_wosdk($touid, $token, $msg, $title, $uri, $desc, $pic, $action_name, $action_link){ if ( ($touid !="") && ($token !="") && ($msg != "") && ($title != "") && ($uri != "") && ($desc != "") && ($pic != "") && ($action_name != "") && ($action_link != "") ) { $url = "https://graph.facebook.com/".$touid."/feed"; $attachment = array( 'access_token' => $token, 'message' => $msg, 'name' => $title, 'link' => $uri, 'description' => $desc, 'picture'=>$pic, 'actions' => json_encode(array('name' => $action_name,'link' => $action_link)) ); // set the target url $ch = curl_init(); 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); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //to suppress the curl output $result = curl_exec($ch); curl_close ($ch); return $result; } else { return 0; } } My Access tokens have this scopes.. Whenever i post anything it getting posted as a visitors post in my fan page.... Pleas help guys... THank in advance.... Edited November 19, 2015 by subhomoy Quote Link to comment https://forums.phpfreaks.com/topic/299519-cant-post-data-to-facebook-page/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.