John Himmelman John Himmelman - 1 year ago 144
PHP Question

Facebook API - How do I get a Facebook user's profile image through the Facebook API (without requiring the user to "Allow" the application)

I'm working on a CMS that fetches a user's profile image from their Facebook URL (that is, How can I accomplish this? Is there a Faceboook API call that fetches a user's profile image URL without the user needing to Allow the application?

Answer Source

Simply fetch the data through this URL:

Replace userid_here with id of the user you want to get the photo of. You can also use HTTPS as well.

You can use the PHP's file_get_contents function to read that URL and process the retrieved data.


Note: In php.ini, you need to make sure that the OpenSSL extension is enabled to use thefile_get_contents function of PHP to read that URL.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download