Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: fsockopen i cookies...
Forum PHP.pl > Forum > Przedszkole
Supol
Czy mozna oderbac (odczytac) cookies wysylany przez stronke otwierana przez fsockopen() questionmark.gif
hwao
Mozna smile.gif
Taki ładniutki nagłówek smile.gif nic tylko go przetowrzyc i juz sie ma smile.gif
(zobacz sobie w naglowkach jak to wyglada:) )
Supol
rzeczywiscie glupie troche pytanko :/ ale dzieki za odp. ale mam kolejne... odebralem juz odpwoeidz i cookies.. jak teraz wyslac jako POST? (jest uwierzytelnanie na cookies)
"Cookie: ...\r\n" tlyko co powinno byc w tych ... ? SESSIONID ? smile.gif a moze ktos ma jakis artykul na ten temat? (wysylanie przez fsocketopen? smile.gif )
hwao
  1. <?php
  2. $posts = array ( 'post_field_1' => 'somevalue',
  3.  'post_field_2' => 'somevalue' );
  4.  
  5. if ( is_array( $posts ) ) {
  6.  foreach( $posts AS $name => $value ){
  7.  $postValues .= urlencode( $name ) . &#092;"=\" . urlencode( $value ) . '&';
  8.  }
  9.  $postValues = substr( $postValues, 0, -);
  10.  $method = &#092;"POST\";
  11. } else {
  12.  $postValues = '';
  13. }
  14.  
  15. $request = &#092;"$method $target$getValues HTTP/1.1rn\";
  16. ?>


Zaprawde powiedam Ci wszytko jest w google i manualu php.net smile.gif
Supol
hmm.. czyli mam prozumiec ze cookies mam wyslac $postValues a nie jako $request.?
hwao
Sorka zapomnialem kawałku
  1. <?php
  2. if ( $method == &#092;"POST\" ) {
  3.  $lenght = strlen( $postValues );
  4.  $request .= &#092;"Content-Type: application/x-www-form-urlencodedrn\";
  5.  $request .= &#092;"Content-Length: $lenghtrn\";
  6.  $request .= &#092;"rn\";
  7.  $request .= $postValues;
  8. }
  9. ?>


Poczytaj manuala i komentarze tam masz calosc "tego"
http://pl.php.net/fsockopen
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.