我有點卡住了。我開發了一個腳本,由於某種原因,它自動將URL中的&
轉換爲&
。什麼會導致&URLS自動轉換爲&?
這是造成問題的行:
$accessToken = file_get_contents('https://graph.facebook.com/oauth/access_token?client_id=' . APPID . '&redirect_uri=' . APPURL . 'callback.php&client_secret=' . APISECRET . '&code=' . $_REQUEST['code']);
而這正是錯誤報告返回:
[20-Jul-2010 15:47:35] PHP Warning: file_get_contents(https://graph.facebook.com/oauth/access_token?client_id=xxxxxxx&redirect_uri=http://apps.facebook.com/xxxxx/callback.php&client_secret=xxxxxx&code=) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request
在/ home/pk1no /的public_html /視頻/回調
。第8行的PHP
有趣的是,這個腳本在我的Joyent專用上工作,但不在我的HostGator專用上。我有點困惑。
我敢肯定這是那些&字符是導致它,因爲當我把與安培我得到瀏覽器的請求「缺失重定向「(後面是第一個&)。如果我將&更改爲&就可以。 – 2010-07-20 21:06:26