Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> PHP i curl - Logowanie
acztery
post
Post #1





Grupa: Zarejestrowani
Postów: 945
Pomógł: 7
Dołączył: 15.03.2005
Skąd: katowice

Ostrzeżenie: (0%)
-----


Hej,

Mam taki kłopot chcę się zalogować na stronę:

https://www.rebvoice.com/login/ przez CURL'a

robię to tak:

  1. $postfields='login[login]='.urlencode($login).'&login[password]='.urlencode($pass);
  2. $this->ch=curl_init();
  3. curl_setopt($this->ch, CURLOPT_URL, $this->url.'/login/');
  4. curl_setopt($this->ch, CURLOPT_RETURNTRANSFER,1);
  5. curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  6. curl_setopt($this->ch, CURLOPT_AUTOREFERER, true);
  7. curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, true);
  8. curl_setopt($this->ch, CURLOPT_POST, 1);
  9. curl_setopt($this->ch, CURLOPT_COOKIEJAR, $this->cookiejar);
  10. curl_setopt($this->ch, CURLOPT_POSTFIELDS, $postfields);
  11. curl_setopt($this->ch, CURLOPT_HEADER, 1);
  12. curl_setopt($this->ch, CURLOPT_CONNECTTIMEOUT, $this->connectTimeout);
  13. curl_setopt($this->ch, CURLOPT_TIMEOUT, $this->timeout);
  14. $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:

  1. ...
  2. $this->cookiejar=realpath(dirname(__FILE__).'/../cookies').'/'.session_id().'.txt';
  3. ...


Ten post edytował acztery 14.01.2012, 20:24:09
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 3.10.2025 - 13:52