Getting empty result within PHP when in browser I get the JSON exception

Posted by Pentium10 on Stack Overflow See other posts from Stack Overflow or by Pentium10
Published on 2010-05-13T13:53:09Z Indexed on 2010/05/13 14:34 UTC
Read the original article Hit count: 401

Filed under:
|
|
|

I have this code:

$url="https://graph.facebook.com/me/friends?access_token=".$access_token."&fields=id,first_name,last_name&limit=10";
$content=file_get_contents($url);

Whenever I use this on a non authenticated user I should get feedback of OAuthException, which doesn't show up in the PHP the $content is empty. While if I copy the URL to the browser I get the result and I see the exception.

I want to detect if the user is logged in and the session data is valid.

What might be wrong?

© Stack Overflow or respective owner

Related posts about php

Related posts about facebook