Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Closed TopicStart new topic
> Curl - Problem
0g0r
post 24.10.2009, 01:15:33
Post #1





Grupa: Zarejestrowani
Postów: 44
Pomógł: 0
Dołączył: 24.10.2009

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


W związku, że to mój pierwszy post (szczerze mnie to dziwi, że wcześniej nie miałem), chciałem się przywitać jak to wypada winksmiley.jpg.
Sytuacja wygląda następująco:
Z curl'em spotkałem się dzisiaj po raz pierwszy. Chciałem się trochę z nim zapoznać itp. Jak widać po godzince troszkę mi zeszło winksmiley.jpg. Ale do rzeczy - Mam napisany skrypt wysyłania maili pośrednio, czyli do mni, a następnie ja muszę, logując dodać każdy z nich. Chodzi o portal Lockerz.com. Stwierdziłbym, że to pewnie jakiś haczyk, gdyby nie to, że znajomy zdobył pendriv'a 2gb smile.gif. A więc... Chce teraz zrobić coś takiego, jak jest w niektórych miejscach w sieci, że wystarczy podać mail i za pomocą Curl'a wszystko powinno się dodać do serwisu, a także powinien zostać wysłany mail z linkiem. Jednak z tego co udało mi się wypocić wychodzi jedynie białe tło...

  1. <?php
  2. $curl = curl_init();
  3. $ch = curl_init('http://lockerz.com');
  4. curl_setopt($curl, CURLOPT_POSTFIELDS, 'name=****&pss=****);
  5. curl_setopt($curl, CURLOPT_POST, 1);
  6. curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  7. curl_exec($curl);
  8. curl_close($curl);
  9. ?>



Tak więc czekam na pomoc smile.gif
Go to the top of the page
+Quote Post
marcio
post 24.10.2009, 01:24:59
Post #2





Grupa: Zarejestrowani
Postów: 2 291
Pomógł: 156
Dołączył: 23.09.2007
Skąd: ITALY-MILAN

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


A cookie,referer i kilka innych to juz nie laska?


--------------------
Zainteresowania: XML | PHP | MY(SQL)| C# for .NET | PYTHON
http://code.google.com/p/form-builider/
Moj blog
Go to the top of the page
+Quote Post
0g0r
post 24.10.2009, 10:25:31
Post #3





Grupa: Zarejestrowani
Postów: 44
Pomógł: 0
Dołączył: 24.10.2009

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


teraz mój kod wygląda tak. Mimo to wciąż biała strona...

  1. $curl = curl_init();
  2. $cookie = "cookies.txt";
  3. $curl = curl_init('http://lockerz.com');
  4. curl_setopt($curl, CURLOPT_POST, 1);
  5. curl_setopt($curl, CURLOPT_HEADER, 1);
  6. curl_setopt($curl, CURLOPT_COOKIE, $cookie);
  7. curl_setopt($curl, CURLOPT_HEADER, 1);
  8. curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  9. curl_setopt($curl, CURLOPT_REFERER, "http://lockerz.com");
  10. curl_setopt($curl, CURLOPT_POSTFIELDS, 'name=***&pass=***');
  11. curl_exec($curl);
  12. curl_close($curl);
Go to the top of the page
+Quote Post
netmare
post 24.10.2009, 10:48:17
Post #4





Grupa: Zarejestrowani
Postów: 285
Pomógł: 37
Dołączył: 18.12.2007
Skąd: Łódź

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



CURLOPT_RETURNTRANSFER
- TRUE to return the transfer as a string of the return value of curl_exec() instead of outputting it out directly.

wiec jak nie chcesz oglądać białej strony to np. echo(curl_exec($curl)); poza tym pierwsza linijka zbędna i raczej CURLOPT_COOKIEJAR niż CURLOPT_COOKIE
Go to the top of the page
+Quote Post
erix
post 24.10.2009, 13:24:49
Post #5





Grupa: Moderatorzy
Postów: 15 467
Pomógł: 1451
Dołączył: 25.04.2005
Skąd: Szczebrzeszyn/Rzeszów




Cytat
PROHIBITED ACTIVITIES

You may not create fake or temporary emails for any purpose in conjunction with sending invites or earning PTZ on Lockerz. You may not use any device, software or routine intended to damage or interfere with the proper working of the Website or to surreptitiously intercept or expropriate any system, data, images or other multimedia elements or personal information from the Website. You may not take any action which imposes an unreasonable or disproportionately large load on our infrastructure, including but not limited to denial of service attacks, auto-generation techniques, "spam" or any other such unsolicited overload technique.

Na przyszłość radzę czytać regulaminy.


--------------------

ZCE :: Pisząc PW załączaj LINK DO TEMATU i TYLKO w sprawach moderacji :: jakiś błąd - a TREŚĆ BŁĘDU? :: nie ponaglaj z odpowiedzią via PW!
Go to the top of the page
+Quote Post

Closed 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: 19.06.2025 - 11:16