title: Facebook API post to friends wall
body: <p>I'm building application to post statuses from authenticated users like <a href="http://www.facebook.com/tarekhassan410/posts/366730226754110" rel="nofollow">that one</a>.</p>
  
  <p>The problem is the application posting from my profile on friends wall who authenticated the application from my profile.</p>
  
  <p>I'm using Facebook API with CodeIgniter.</p>
  
  <p>the code</p>
  
  <pre><code>            $userId = $this-&gt;facebook-&gt;getUser();
          $IDs = $this-&gt;facebook_data-&gt;get_IDs();
          if(isset($_POST['link'])){
              $args = array(
                  'from'  =&gt; array('name'=&gt;'Resala','id'=&gt;'294357147348261'),
                  'application'=&gt;array('name'=&gt;'XXXX','id'=&gt;'XXXXX'),
                  'name'  =&gt;'XXXX',
                  'message'   =&gt; $_POST['status2'],
                  'link'      =&gt; $_POST['link']
              );
          }else{
              $args = array(
                  'from'  =&gt; array('name'=&gt;'Resala','id'=&gt;'294357147348261'),
                  'application'=&gt;array('name'=&gt;'Resala','id'=&gt;'XXXXX'),
                  'name'  =&gt;'XXXX',
                  'message'   =&gt; $_POST['status1']
              );
          }
          foreach($IDs-&gt;result() as $row){
              $ID=$row-&gt;user_id;
              $this-&gt;facebook-&gt;api("/$ID/feed", "post", $args);
          }
  </code></pre>