Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Curl - logowanie do strony
sebax3x
post
Post #1





Grupa: Zarejestrowani
Postów: 43
Pomógł: 0
Dołączył: 8.03.2008

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


Witam

Mam problem z logowaniem na stronę m.videobox.com.

Mój kod wygląda tak:

  1. $ch = curl_init();
  2. curl_setopt($ch, CURLOPT_URL, 'http://m.videobox.com/j_spring_security_check');
  3. curl_setopt($ch, CURLOPT_POSTFIELDS, 'login-page=login-page&j_username=moj_login&j_password=moje_haslo&_spring_security_remember_me=true&x=44&y=23');
  4. curl_setopt($ch, CURLOPT_POST, 1);
  5. curl_setopt($ch, CURLOPT_TIMEOUT, '15');
  6. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  7. curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
  8. curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
  9. $headers = array(
  10. 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  11. 'Accept-Encoding: gzip, deflate',
  12. 'Accept-Language: pl,en-us;q=0.7,en;q=0.3',
  13. 'Connection: keep-alive',
  14. 'Host: m.videobox.com',
  15. 'Referer: <a href="http://m.videobox.com/login'" target="_blank">http://m.videobox.com/login'</a>,
  16. 'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0',
  17. 'Content-Length 107',
  18. 'Content-Type: application/x-www-form-urlencoded'
  19. );
  20. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  21.  
  22. $xmlstr = curl_exec($ch);
  23. curl_close($ch);
  24. $ch = curl_init();
  25. curl_setopt($ch, CURLOPT_URL, 'http://m.videobox.com/browse/scenes');
  26. curl_setopt($ch, CURLOPT_TIMEOUT, '15');
  27. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  28. curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
  29. curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
  30. $headers = array(
  31. 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  32. 'Accept-Encoding: gzip, deflate',
  33. 'Accept-Language: pl,en-us;q=0.7,en;q=0.3',
  34. 'Connection: keep-alive',
  35. 'Host: vb2.videobox.com',
  36. 'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0'
  37. );
  38. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  39.  
  40. $xmlstr = curl_exec($ch);
  41. curl_close($ch);


Jak ktoś pomoże mi z tym problemem to prześlę dane login i hasło (do videobox) do testów, mogę także zapłacić.
Zależy mi na szybkim rozwiązaniu problemu.
Go to the top of the page
+Quote Post

Posty w temacie
- sebax3x   Curl - logowanie do strony   27.04.2013, 14:36:18
- - Saki   Cytat(sebax3x @ 27.04.2013, 15:36:18 ...   28.04.2013, 09:58:38


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: 16.10.2025 - 20:58