Jump to content

Recommended Posts

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...

 

Screen_Shot_20151119201728_2.jpg

 

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..

 

Screen_Shot_20151119201728.jpg

 

 

Whenever i post anything it getting posted as a visitors post in my fan page....

 

 

Pleas help guys...

 

THank in advance....

Edited by subhomoy
Link to comment
https://forums.phpfreaks.com/topic/299519-cant-post-data-to-facebook-page/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.