file_get_contents mit POST

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • file_get_contents mit POST

    Hallo,
    ich möchte mittels file_get_contents und POST, Formulardaten an eine Seite weitergeben. Aber irgend etwas scheint noch nicht zu stimmen, weil die Daten nicht angenommen werden. Ich denke der Fehler liegt irgendwo an der Belegung der Variable $contextOptions (Anm. SESSION ist eine Konstante die ich vorab definiert habe. Deren Inhalt sieht so aus:
    "Cookie: dfee=3cc0e907619f97a7b796774ec9d1eb11; SID=72c849aeb9d54e4cfe01647edad02db7"


    PHP Code:
    $body http_build_query(array( 
    "recipient" => $recipient
    "sender" => $sender,
    "msgbody" => $message));
        
    $contextOptions = array("http" => array ( 
    "method" => "POST",
    "header" => SESSION 
    "Content-type:application/x-www-form-urlencoded" 
    "Content-length: "strlen($body) . "\r\n"
    "content" => $body));

    $context stream_context_create($contextOptions);
    $url "http://www.example.de/page.html";
    $page file_get_contents($urlfalse,$context); 
    Kann mir jemand auf die Sprünge helfen?

    TIA, Alex

  • #2
    ich glaube, das macht man besser hiermit:
    http://www.php-faq.de/q/q-code-post.html

    Comment


    • #3
      Juhuuuu

      Danke! Nun gehts!!!

      Comment

      Working...
      X