I am trying retrieve user name from the code through graph api, the below code was working fine when while I was hosting app on another(godaddy) server but recently I moved the application to phpfog and since then am facing this weird problem.
try {
$userId = $_POST["user_id"];
$oauth_token = $_POST["oauth_token"];
$userName = json_decode(file_get_contents('https://graph.facebook.com/' . $userId)) -> name;
$userGender = json_decode(file_get_contents('http://graph.facebook.com/' . $userId)) -> gender;
$userPpicture = json_decode(file_get_contents('http://graph.facebook.com/' . $userId)) -> picture;
} catch(Exception $e) {
echo $e -> getMessage();
echo "<br>";
}
just to add as this may help that in the very next line i can sucessfully retreive user profile picture through this:
<img class=\"ppicture\" src=\"https://graph.facebook.com/" . $userId . "/picture?type=large\">
Beside this piece of code not working, the photo posting functionality has just also stopped working. kindly help me with this.
thankyou.