title: how to post on friends' walls using php sdk?
body: <p>i am trying to post to my friends' feeds using this code, but it is not working . i am stuck, any help ??</p>
  
  <pre><code> $app_url ="http://localhost.local/PMS/facebook/PostWithPHP.php";
  
   $facebook = new Facebook(array(
  'appId'  =&gt; 'APPID',
  'secret' =&gt; 'APPSECRET',
  'cookie' =&gt; true,
  ));
  
  
    // Get User ID
  $user = $facebook-&gt;getUser();
  
  if ($user) {
  
  $user_friends = $facebook-&gt;api('/me/friends');
  sort($user_friends['data']);
  
  try {
  // Proceed knowing you have a logged in user who's authenticated.
  $access_token = $facebook-&gt;getAccessToken();
  $vars = array(
       'message' =&gt; 'My Message',
       'name' =&gt; 'title',
       'caption' =&gt; 'Caption',
       'link' =&gt; 'Link',
       'description' =&gt; 'Description',
       'picture' =&gt; 'image'
  );
  
  foreach($user_friends['data'] as $f){
          $sendTo = $f['id'];
          $sendToName = $f['name'];
  
          $result = $facebook-&gt;api("/".$sendTo ."/feed", 'post', $vars);
      }
      } catch (FacebookApiException $e) {
      error_log($e);
      $user = null;
     }
    }
  
   // Login or logout url will be needed depending on current user state.
  if ($user) {
    $logoutUrl = $facebook-&gt;getLogoutUrl();
  } else {
    $loginUrl = $facebook-&gt;getLoginUrl(array('redirect_uri'=&gt; $app_url));
    echo "&lt;script type='text/javascript'&gt;";
    echo     "top.location.href = '{$loginUrl}';";
    echo "&lt;/script&gt;";
  }
  </code></pre>
  
  <p>and another question is that using this code, but with replacing $facebook->api("/".$sendTo ."/feed", 'post', $vars); by $facebook->api("/me/feed", 'post', $vars); and of course without looping friends, posts on my timeline. how can i make it post on my wall ??</p>