我试图使用卷曲做Facebook的身份验证和这里就是我有:Facebook验证
$url = "https://graph.facebook.com/oauth/access_token";
$postString = "?client_id=$client_id&redirect_uri=$redirect_uri&client_secret=$client_secret&code=$code";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_FAILONERROR, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
//curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postString);
$response = curl_exec($curl);
但每次它只是返回false。
我很新的使用cURL,所以我可能会犯一些初学者的错误,但我很困惑,为什么这不起作用。
任何帮助将不胜感激!
解决了它,这是一个ssl问题,并在我的$ postString var(开头的'?')中出现错字。 – machinemessiah 2010-10-06 00:52:56