【发布时间】:2014-04-13 17:53:17
【问题描述】:
在 webhost (cloudaccess.net) 中执行此 php 代码后出现此错误。
{"error":{"message":"(#5) 未经授权的源IP地址","type":"OAuthException","code":5}}
谁能帮助我...?
<?php error_reporting(0);
function url_get_contents ($url) {
if (!function_exists('curl_init')){
die('CURL is not installed!');
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$output = curl_exec($ch);
curl_close($ch);
return $output;
}
$graph_url = 'https://graph.facebook.com/me?access_token=VALID_TOKEN';
$graph_data = url_get_contents($graph_url);
echo $graph_data;
?>
【问题讨论】: