Page requests not working in php

Permalink
I keep getting this response:
Warning: file_get_contents(https://graph.facebook.com/oauth/access_token?client_id=162253007120080&client_secret=3446aba7f25a11b54c011882f2edee6f&grant_type=client_credentials) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request in /home/andym/public_html/test01/blocks/andy_test/view.php on line 43
The page request works fine fron the browser ie client side

https://graph.facebook.com/oauth/access_token?client_id=332380666799...

Returning:

access_token=332380666799028|ViPyjTBbBqyIk7aMaFOG47rTJjg

View.php contains:

$token_url = "https://graph.facebook.com/oauth/access_token?client_id=332380666799028&client_secret=3446aba7f25a11b54c011882f2edee6f&grant_type=client_credentials" ;
    $response = file_get_contents($token_url);
    $params = null;
    parse_str($response, $params);
    $access_token = $params['access_token'];
    $response = file_get_contents($token_url);
    $params = null;
    parse_str($response, $params);
    $access_token = $params['access_token'];


Any ideas?

 
Andym2009 replied on at Permalink Reply
Ok - further testing suggests I have done something really dumb ;-)
Forget this for now.