Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Curl, nie mogę przejąć cookies i ich użyć
matiit
post 25.08.2010, 14:24:11
Post #1





Grupa: Zarejestrowani
Postów: 365
Pomógł: 70
Dołączył: 5.04.2009

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


  1. $c = curl_init('http://turbobit.net');
  2. curl_setopt($c, CURLOPT_URL, 'http://turbobit.net');
  3. curl_setopt ($c, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
  4. curl_setopt ($c, CURLOPT_RETURNTRANSFER, 1);
  5. curl_setopt($c, CURLOPT_POST, 1);
  6. curl_setopt($c, CURLOPT_POSTFIELDS, 'user%5Blogin%5D=' + $acc['log'] +"&user%5Bpass%5D="+ $acc['pass']);
  7. //curl_setopt ($c, CURLOPT_FOLLOWLOCATION, 1);
  8. $cookie = "/srv/http/test/regexturbobit/cookie.txt";
  9. curl_setopt ($c, CURLOPT_COOKIEJAR, $cookie);
  10. $output=curl_exec($c);
  11. echo "<pre>" +$output+"</pre>"."<br />";
  12.  
  13. curl_close($c);
  14.  
  15. $c = curl_init('http://turbobit.net' );
  16. curl_setopt($c, CURLOPT_URL, 'http://turbobit.net');
  17. curl_setopt ($c, CURLOPT_RETURNTRANSFER, 1);
  18. curl_setopt ($c, CURLOPT_COOKIEFILE, $cookie);
  19. curl_setopt ($c, CURLOPT_RETURNTRANSFER, true);
  20. $output=curl_exec($c);
  21. echo "<pre>" +$output+"</pre>"."<br />";
  22.  
  23. echo "<pre>" +$output+"</pre>";
  24. curl_close($c);

$acc['log'] i pass to stringi z loginem i hasłem.
Dostaję tylko wynik 0

Ten post edytował matiit 25.08.2010, 14:29:40
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Wersja Lo-Fi Aktualny czas: 31.07.2025 - 08:33