How to get profile image via authentication using facebook API php

6

I would like to know how to copy an image from a link without extension, that is, I already used several methods that work for images with extension, but without extension I have not yet, where will I use to copy the image of the Facebook profile when people access my system.

Image url example

I'm using this function in javascript:

FB.api('/me', {fields: 'name,email,picture,gender,age_range,link,locale'}, function(response) {});

Where do I get the url response described above. I know it has an image extension, but putting only the extension to access the image, it has the following error:

  

"An error occurred while processing your request.   Reference # 50.2f2cfea5.1441047871.5277eeef "

    
asked by anonymous 28.08.2015 / 20:30

1 answer

5

The best way, in this case, is to create an authentication through the Facebook API in PHP. That way, you'll be able to get information from the user's profile and pass it on to your site. Your question should be edited.

With this you would get the photo of the CURRENT profile of the user simply with this (and many other settings):

<img src="https://graph.facebook.com/<?phpecho$_SESSION['USERNAME'];?>/picture">

Font

    
29.08.2015 / 00:17