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, http://facebook.com/users_unique_url). 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: Simply fetch the data through this URL: http://graph.facebook.com/userid_here/picture Replace userid_here with id of the user you want to get the photo of. You can
undefined
How to post data in PHP using file_get_contents? I'm using PHP's function file_get_contents() to fetch contents of a URL and then I process headers through the variable $http_response_header. Now the problem is that some of the URLs need some data to be posted to the URL (for example, login pages). How do I do that? I realize using stream_context I may be able to do that but I am not entirely clear. Thanks. Answer: Sending an HTTP POST request using file_get_contents is not that hard, actually : as
undefined
How do I send a POST request with PHP? Actually I want to read the contents that come after the search query, when it is done. The problem is that the URL only accepts POST methods, and it does not take any action with GET method... I have to read all contents with the help of domdocument or file_get_contents(). Is there any method that will let me send parameters with POST method and then read the contents via PHP? Solution : CURL-less method with PHP5: $url = 'http://server.com/path'; $data = array('key1' => 'value1',
undefined
PHP file_get_contents() returns “failed to open stream: HTTP request failed!” Problem : I am having problems calling a url from PHP code. I need to call a service using a query string from my PHP code. If I type the url into a browser, it works ok, but if I use file-get-contents() to make the call, I get: Warning: file-get-contents(http://.... ) failed to open stream: HTTP request failed! HTTP/1.1 202 Accepted in ... The code I am using is: $query=file_get_contents('http://###.##.##.##/mp/get?mpsrc=http://mybucket.s3.amazonaws.com/11111.mpg&mpaction=convert format=flv'); echo($query); Like