Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]{Curl} Logowanie za pomocą Curl'a i pobieranie danych.
Rewil
post
Post #1





Grupa: Zarejestrowani
Postów: 175
Pomógł: 0
Dołączył: 19.09.2009

Ostrzeżenie: (10%)
X----


Jednak dalej błąd ;/
  1. Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/gamin/domains/gamingpl.com
  2. /public_html/global/curl.php on line 14


  1. function connect_curl($url, $post='')
  2. {
  3. $curl=curl_init();
  4. curl_setopt($curl, CURLOPT_URL, $url);
  5. curl_setopt($curl, CURLOPT_REFERER, "http://gamingpl.com");
  6. curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
  7. curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; Linux i686; pl; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3');
  8. curl_setopt($curl, CURLOPT_TIMEOUT, 30);
  9. curl_setopt($curl, CURLOPT_HEADER, 0);
  10. if(strlen($post)>0)
  11. {
  12. curl_setopt($curl, CURLOPT_POST, 1);
  13. curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
  14. }
  15. $strona=curl_exec($curl);
  16. echo $strona;
  17. curl_close($curl);
  18. }
  19.  
  20. connect_curl('http://www.gambling-affiliation.com/_front/login.php', $post='_qf__authentification=&login=&password=&type=0&submit=Connexion');


Ten post edytował Rewil 29.06.2010, 16:22:40
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Rewil
post
Post #2





Grupa: Zarejestrowani
Postów: 175
Pomógł: 0
Dołączył: 19.09.2009

Ostrzeżenie: (10%)
X----


  1. function connect_curl($url, $post='')
  2. {
  3. $curl=curl_init();
  4. curl_setopt($curl, CURLOPT_URL, $url);
  5. curl_setopt($curl, CURLOPT_REFERER, "http://gamingpl.com");
  6. curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 0);
  7. curl_setopt($curl, CURLOPT_COOKIEJAR, 1);
  8. curl_setopt($curl, CURLOPT_COOKIEFILE, 1);
  9. curl_setopt($curl, CURLOPT_HEADER, 1);
  10. curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; Linux i686; pl; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3');
  11. curl_setopt($curl, CURLOPT_TIMEOUT, 30);
  12. curl_setopt($curl, CURLOPT_HEADER, 0);
  13. if(strlen($post)>0)
  14. {
  15. curl_setopt($curl, CURLOPT_POST, 1);
  16. curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
  17. }
  18. $strona=curl_exec($curl);
  19. curl_close($curl);
  20. }
  21.  
  22. connect_curl('http://www.gambling-affiliation.com/en/index.html', $post='');
  23. echo $strona;


Aktualizacja kodu, to nie to. Dalej nic nie wyświetla(pusta strona);

Ten post edytował Rewil 29.06.2010, 21:22:43
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: 6.10.2025 - 15:42