Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get the pid from this FB Script?
    primarykey
    data
    text
    <p>I have coded this little script, which upload a photo (images/hand.jpg) into a users profile in the default application album (in the app-album from witch im calling this script).</p> <p>Now i have a problem. I would like to get the unique pid (picture id) of the just uploaded photo. When I try to echo $data, there is a int like this: </p> <p>120629757986939</p> <p>which appears to be the fbid of the created object:</p> <p><a href="http://www.facebook.com/photo.php?pid=115842&amp;id=" rel="nofollow noreferrer">http://www.facebook.com/photo.php?pid=115842&amp;id=</a><strong>100001197451821</strong>&amp;ref=fbx_album&amp;fbid=120629757986939</p> <p>I need this one: </p> <p>.../photo.php?pid=<strong>115842</strong>&amp;id=100001197451821&amp;ref=fbx_album&amp;fbid=120629757986939</p> <p>Does anyone knows how to get this value? Thanks for all your help, Camillo</p> <p>Below the script what i am using to upload the photo:</p> <pre><code> $uid = $facebook-&gt;getUser(); $me = $facebook-&gt;api('/me'); $token = $session['access_token'];//here I get the token from the $session array $album_id = $album[0]; //upload your photo $file= 'images/hand.jpg'; $args = array( 'message' =&gt; 'Photo from application', ); $args[basename($file)] = '@' . realpath($file); $ch = curl_init(); $url = 'https://graph.facebook.com/'.$album_id.'/photos?access_token='.$token; $data = post($url, $referer, $agent, $cookie, $args, 1); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $args); $data = curl_exec($ch); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload