Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Curl, posty w przemo.
--Amazing--
post
Post #1





Goście







Hej.

Próbuje zrobić abym przez curla mógł wysyłać posty na php by przemo.

Ale aby to zrobić najprawdopodobniej postem musze przesłać "SID" , który generowany jest w headerze " Set-Cookie: bb038dfef1_sid=ef91cd3f32fab50d8c45c64ec4503d7a;"

Tekst pogrubiony musze wrzucić w zmienną post "sid"..

Aktualnie mam tak pisanie postów:

  1. $ch2 = curl_init("http://bezreklamy.eu/posting.php?mode=newtopic&f=97");
  2. curl_setopt($ch2, CURLOPT_RETURNTRANSFER, false);
  3. curl_setopt($ch2, CURLOPT_HEADER, true);
  4. curl_setopt($ch2, CURLOPT_COOKIEFILE, $filename);
  5. curl_setopt($ch2, CURLOPT_COOKIEJAR, $filename); // tutaj cookie juz uzupełnione przez logowanie
  6. curl_setopt($ch2, CURLOPT_REFERER, "");
  7. curl_setopt($ch2, CURLOPT_USERAGENT, $useragent); // mozilla firefox
  8. $post2['subject'] = 'test'; // nazwa tematu
  9. $post2['message'] = 'tescik'; // tresc tematu
  10. $post2['mode'] = 'newtopic'; // mode
  11. $post2['post_parent'] = '0'; // zmienna ukryta
  12. $post2['f'] = '97'; // zmienna ukryta
  13. $post2['sid'] = 'cos'; // no moj kochany sid
  14. curl_setopt($ch2, CURLOPT_POSTFIELDS, prepare_request($post2));
  15. curl_setopt($ch2, CURLOPT_FOLLOWLOCATION, TRUE);
  16. curl_exec($ch2);
  17. curl_close($ch2);


No i wyświetla się strona z tworzeniem tematu.

Pozdrawiam.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 4)
--amazing--
post
Post #2





Goście







refresh
Go to the top of the page
+Quote Post
-Gość-
post
Post #3





Goście







ref
Go to the top of the page
+Quote Post
-ref-
post
Post #4





Goście







refresh
Go to the top of the page
+Quote Post
b4rt3kk
post
Post #5





Grupa: Zarejestrowani
Postów: 1 933
Pomógł: 460
Dołączył: 2.04.2010
Skąd: Lublin

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


Klucz sesji jest zapewne zapisany w ciasteczku, które tworzysz curlem. Odczytaj sobie zawartość ciasteczka.
Go to the top of the page
+Quote Post

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: 4.10.2025 - 21:07