i've tried to take the user's profile photo with using graph api, i take first name, email,fb id exc true, but i fail on taking the user's profile pictures, tried everything and read everything but failed.
After connecting with facebook, it shows a big question mark in the photo areas in my websites' profile picture area for the profiles..
Also there is no problem about temp_fb_id parametre, its inserting that true too
Here is my codes :
// above is the part with sessions getting user id, user email exc.
// $temp_fb_id is the variable that i use for taking the info for user name exc and its working but with photo part, not working ,
// img src is showing https://graph.facebook.com//picture?type=square,with a output, big question mark
$first_name = $user->first_name;
$last_name = $user->last_name;
$photo = "https://graph.facebook.com/{$temp_fb_id}/picture?type=square";
$photothumb = "https://graph.facebook.com/{$temp_fb_id}/picture?type=normal";
$photolarge = "https://graph.facebook.com/{$temp_fb_id}/picture?type=large";
try {
$fb_insert = "INSERT INTO `members`(`first_name`, `photo_small`, `photo_thumb`, `photo`, `last_name`, `fb_id`) VALUE(:first_name, :photo, :photothumb, :photolarge, :last_name, :temp_fb_id)";
$fb_insert_do = $db->prepare($fb_insert);
$fb_insert_do->bindParam(':first_name', $first_name, PDO::PARAM_STR);
$fb_insert_do->bindParam(':last_name', $last_name, PDO::PARAM_STR);
$fb_insert_do->bindParam(':photo', $photo, PDO::PARAM_STR);
$fb_insert_do->bindParam(':photothumb', $photothumb, PDO::PARAM_STR);
$fb_insert_do->bindParam(':photolarge', $photolarge, PDO::PARAM_STR);
$fb_insert_do->execute();
}
catch(PDOException $e) {
/* catch and log errors over here. */
}
Thank You