I'm trying to make my app post on the user's wall. Under the post is a link to the app page on fb, i want a link to the app itself, so i'm trying actions, name and link. but for some reason there is only 'A' and the url becomes my url with "/A" added, so it doesn't work anymore:(
Can s开发者_高级运维omeone help me please? Probably I made a stupid mistake so won't take much of you time. Thanks!
Part of my code:
$action = array('name' => $aname, 'link' => $alink);
$actions = json_encode($action);
$apprequest_url = "https://graph.facebook.com/$userid/feed";
$parameters = "?access_token=" . $access . "&message=" .
$mymessage . "&actions=" . $action . "&method=post";
$myurl = $apprequest_url . $parameters;
$result = file_get_contents($myurl);
So it does work, only there is a problem with the actions part...
Change the line:
$mymessage . "&actions=" . $action . "&method=post";
to:
$mymessage . "&actions=" . urlencode($actions) . "&method=post";
精彩评论