使用php和curl登录到Google语音的cookie问题?
问题描述:
我正在尝试使用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
答
我也有同样的problem.You做GET请求与饼干enabled.use该cookie,而POST too.it工作正常。
会发生什么,如果你还可以定义'CURLOPT_COOKIEJAR'为同一个文件? – Wrikken 2012-01-12 20:09:16
感谢看着它Wrikken,我接着说:\t curl_setopt($本 - > _ CH,CURLOPT_COOKIEJAR,$此 - > _ cookieFile);',但一切都没有改变。我仍然得到相同的错误 – 2012-01-12 21:18:43
嗯,你肯定使用类的相同实例吗?你可以检查/提供(匿名)请求和响应头文件吗? – Wrikken 2012-01-12 23:14:09