Mam taki kłopot chcę się zalogować na stronę:
https://www.rebvoice.com/login/ przez CURL'a
robię to tak:
$this->ch=curl_init(); curl_setopt($this->ch, CURLOPT_URL, $this->url.'/login/'); curl_setopt($this->ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($this->ch, CURLOPT_AUTOREFERER, true); curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($this->ch, CURLOPT_POST, 1); curl_setopt($this->ch, CURLOPT_COOKIEJAR, $this->cookiejar); curl_setopt($this->ch, CURLOPT_POSTFIELDS, $postfields); curl_setopt($this->ch, CURLOPT_HEADER, 1); curl_setopt($this->ch, CURLOPT_CONNECTTIMEOUT, $this->connectTimeout); curl_setopt($this->ch, CURLOPT_TIMEOUT, $this->timeout); $out=curl_exec($this->ch);
i nie działa
Wyśwela mi
Kod
HTTP/1.1 302 Found Date: Sat, 14 Jan 2012 19:18:23 GMT Server: Apache P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT" Set-Cookie: PHPSESSID=27v3oeg20qi58e7teafltcpk35; expires=Mon, 23-Apr-2012 19:18:23 GMT; path=/; HttpOnly Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Location: https://www.voipdiscount.com/warning.html Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=UTF-8 HTTP/1.0 200 OK Date: Sat, 14 Jan 2012 19:18:24 GMT Server: Apache P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT" Set-Cookie: PHPSESSID=g97rbqv99pebsv3or9fo84ql10; expires=Mon, 23-Apr-2012 19:18:24 GMT; path=/; HttpOnly Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Description: Free phone calls with VoipDiscount. Call your online friends for free as well as a special selection of popular international destinations. Keywords: free call, voip, download, cheap calls, free sms, discount voip Connection: close Content-Type: text/html; charset=utf-8
A ich system logowania już wyśwetla swój błąd.
"Sorry, but your session has already expired. Click here to go back and refresh the page again."
Co mam zrobić by to przeszło ma ktoś jakiś pomysł. może jakiś nagłówek.
Gdzie "$this->cookiejar" to:
... ...