Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] fsockopen -> polaczenie z serwerwm www
bamboos
post 14.05.2004, 18:50:16
Post #1





Grupa: Zarejestrowani
Postów: 115
Pomógł: 0
Dołączył: 3.05.2003
Skąd: Łódź

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


W manualu do [manual:b6f93402ea]fsockopen[/manual:b6f93402ea] jest ladny przyklad, jak wyslac dane metoda post i get do serwera. Nie moge jednak znalesc sposobu na przeslanie zawartosci ciastek?!?
Jak wyslac ciastko do serwera przez fsockopen?!? Jak powinno wygladac zapytanie?

[php:1:b6f93402ea]<?php
$request = "$method $target$getValues HTTP/1.1rn";
$request .= "Host: $hostrn";
$request .= 'User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) ';
$request .= "Gecko/20021204rn";
$request .= 'Accept: text/xml,application/xml,application/xhtml+xml,';
$request .= 'text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,';
$request .= "image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1rn";
$request .= "Accept-Language: en-us, en;q=0.50rn";
$request .= "Accept-Encoding: gzip, deflate, compress;q=0.9rn";
$request .= "Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66rn";
$request .= "Keep-Alive: 300rn";
$request .= "Connection: keep-alivern";
$request .= "Referer: $refererrn";
$request .= "Cache-Control: max-age=0rn";

if ( $method == "POST" ) {
$lenght = strlen( $postValues );
$request .= "Content-Type: application/x-www-form-urlencodedrn";
$request .= "Content-Length: $lenghtrn";
$request .= "rn";
$request .= $postValues;
}
?>[/php:1:b6f93402ea]

PS. bardzo przepraszam za brak polskich literek... uzupelnie jak tylko przywroce klawiature do zycia!smile.gif


--------------------
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
FiDO
post 14.05.2004, 19:20:57
Post #2





Grupa: Przyjaciele php.pl
Postów: 1 717
Pomógł: 0
Dołączył: 12.06.2002
Skąd: Wolsztyn..... Studia: Zielona Góra

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


Przejrzyj komentarze do fsockopen w manualu, tam jest kilka przykladow jak wyslac ciacha.


--------------------
Brak czasu :/
Go to the top of the page
+Quote Post
bamboos
post 14.05.2004, 19:25:45
Post #3





Grupa: Zarejestrowani
Postów: 115
Pomógł: 0
Dołączył: 3.05.2003
Skąd: Łódź

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


Kod
"Cookie: cookie_name=cookie_value; name_cookie2=value_cookie2rn"

Dzieki!!


--------------------
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 Wersja Lo-Fi Aktualny czas: 19.07.2025 - 07:35