2012-01-12 83 views
0

我正在嘗試使用curl和谷歌語音課程https://github.com/aaronpk/Google-Voice-PHP-API登錄谷歌語音,發送短信。使用php和curl登錄到Google語音的cookie問題?

我收到以下錯誤:「您的瀏覽器的cookie功能被關閉。請打開它。 「

問題的登錄過程中的根就在下面的代碼[?]:

curl_setopt($this->_ch, CURLOPT_URL, 'https://www.google.com/accounts/ServiceLoginAuth?service=grandcentral'); 
    curl_setopt($this->_ch, CURLOPT_POST, TRUE); 
      curl_setopt($this->_ch, CURLOPT_COOKIEFILE, $this->_cookieFile); 
    curl_setopt($this->_ch, CURLOPT_POSTFIELDS, array(
     'Email' => $this->_login, 
     'Passwd' => $this->_pass, 
     'continue' => 'https://www.google.com/voice/account/signin', 
     'service' => 'grandcentral', 
     'GALX' => $GALX 
     )); 

    $html = curl_exec($this->_ch); 

誰能告訴我該怎麼做?

由於提前,

KC

+0

會發生什麼,如果你還可以定義'CURLOPT_COOKIEJAR'爲同一個文件? – Wrikken 2012-01-12 20:09:16

+0

感謝看着它Wrikken,我接着說:\t curl_setopt($本 - > _ CH,CURLOPT_COOKIEJAR,$此 - > _ cookieFile);',但一切都沒有改變。我仍然得到相同的錯誤 – 2012-01-12 21:18:43

+0

嗯,你肯定使用類的相同實例嗎?你可以檢查/提供(匿​​名)請求和響應頭文件嗎? – Wrikken 2012-01-12 23:14:09

回答

0

我也有同樣的problem.You做GET請求與餅乾enabled.use該cookie,而POST too.it工作正常。