Note that there are some explanatory texts on larger screens.

plurals
  1. POCSRF state token does not match one provided
    text
    copied!<p>Getting server error log with this code.. and also this code giving me only my 81 friends , but i have 87 friends in my friend list .. </p> <p>Give me a suggestion..</p> <pre><code> &lt;?php require_once('facebook-php-sdk/src/facebook.php'); $config = array('appId' =&gt; 'Your app id','secret' =&gt; 'Your app secret',); $facebook = new Facebook($config); $user_id = $facebook-&gt;getUser(); if($user_id) { // We have a user ID, so probably a logged in user. // If not, we'll get an exception, which we handle below. try { $access_token = $facebook-&gt;getAccessToken(); $usrFrnd_data = array(); $offset = 0; $limit = 5000; //fetch events from Facebook API $user = null; $c = curl_init(); curl_setopt($c, CURLOPT_URL, "https://graph.facebook.com/me/friends/?limit=$limit&amp;offset=$offset&amp;access_token=".$access_token); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($c, CURLOPT_SSL_VERIFYHOST, false); $user = json_decode(curl_exec($c)); curl_close($c); $tmpVar = object2Array($user); $usrFrnd_data = array_merge($usrFrnd_data, $tmpVar["data"]); //loop through pages to return all results while(array_key_exists("next", $tmpVar["paging"])) { $offset += $limit; $c = curl_init(); curl_setopt($c, CURLOPT_URL, "https://graph.facebook.com/me/friends/?limit=$limit&amp;offset=$offset&amp;access_token=".$access_token); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($c, CURLOPT_SSL_VERIFYHOST, false); $user = json_decode(curl_exec($c)); curl_close($c); $tmpVar = object2Array($user); // make sure we do not merge with an empty array if (count($tmpVar["data"]) &gt; 0){ $usrFrnd_data = array_merge($usrFrnd_data, $tmpVar["data"]); } else { // if the user entry is empty, we have reached the end, exit the while loop break; } } echo "&lt;pre&gt;"; print_r($usrFrnd_data); }catch(FacebookApiException $e) { // If the user is logged out, you can have a // user ID even though the access token is invalid. // In this case, we'll get an exception, so we'll // just ask the user to login again here. $login_url = $facebook-&gt;getLoginUrl(); echo 'Please &lt;a href="' . $login_url . '"&gt;login.&lt;/a&gt;'; error_log($e-&gt;getType()); error_log($e-&gt;getMessage()); } } else { // No user, so print a link for the user to login $login_url = $facebook-&gt;getLoginUrl(); echo 'Please &lt;a href="' . $login_url . '"&gt;login.&lt;/a&gt;'; } function object2Array($d){ if (is_object($d)){ $d = get_object_vars($d); } if (is_array($d)) { return array_map(__FUNCTION__, $d); } else { return $d; } } ?&gt; </code></pre>
 

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