Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Jak przesłać "ręcznie" metodą POST dane
spawelz
post
Post #1





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 24.06.2004

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


Jak przesłać "ręcznie" metodą POST dane do skryptu przetwarzającego formularze? Jak spreparować nagłówki i przesłać zakodowane pary: zmienna=wartość.
Z góry dzieki
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 3)
Seth
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 2 335
Pomógł: 6
Dołączył: 7.03.2002

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


Tak wygladaja przykladowe naglowki POSTa:
Cytat
POST http://pl.php.net/search.php HTTP/1.1
Host: pl.php.net
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; PL; rv:1.6) Gecko/20040113
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
Accept-Language: pl,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Referer: http://pl.php.net/
Content-Type: application/x-www-form-urlencoded
Content-Length: 39

pattern=fsockopen&show=quickref&x=8&y=3

Teraz trzeba to tylko ladnie wyslac fsockopen.
Go to the top of the page
+Quote Post
spawelz
post
Post #3





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 24.06.2004

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


Jestem zielony z php. Czym mozna odczytać taki nagłówek Post. I jakby sie komuś chciało to niech napisze co trzeba dokładnie zrobić jak już mam ten nagłówek. Dzieki z pomoc!!
Go to the top of the page
+Quote Post
hwao
post
Post #4


Developer


Grupa: Moderatorzy
Postów: 2 844
Pomógł: 20
Dołączył: 25.11.2003
Skąd: Olkusz




Wysyła sie tak
  1. <?php
  2. $resFp = fsockopen( 'http://pl.php.net/search.php', 80, $errno, $errstr, 30 );
  3. if (!$resFp) {
  4.  echo &#092;"$errstr ($errno)<br />n\";
  5. } else {
  6.  
  7. $dane = &#092;"POST http://pl.php.net/search.php HTTP/1.1 rn
  8. Host: pl.php.netrn
  9. User-Agent: Mozilla/5.(Windows; U; Windows NT 5.2; PL; rv:1.6) Gecko/20040113rn
  10. Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1rn
  11. Accept-Language: pl,en-us;q=0.7,en;q=0.3rn
  12. Accept-Encoding: gzip,deflatern
  13. Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.7rn
  14. Keep-Alive: 300rn
  15. Referer: http://pl.php.net/rn
  16. Content-Type: application/x-www-form-urlencodedrn
  17. Content-Length: 39rn
  18. pattern=fsockopen&show=quickref&x=8&y=3rn\";
  19.  
  20.    fwrite($resFp, $dane);
  21.    /*
  22.    while (!feof($resFp)) {
  23.  echo fgets($resFp, 128);
  24.    }
  25. */
  26.  fclose($resFp);
  27. ?>

Chyba tak ale nie jestem pewien...
& #33; zamien na !
Go to the top of the page
+Quote Post

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 Aktualny czas: 21.08.2025 - 06:37