Advertisement
Guest User

Untitled

a guest
Sep 26th, 2016
479
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.58 KB | None | 0 0
  1. <?php
  2.  
  3. // URL DER ADRESSE AN DEM DER POST GESENDET WIRD
  4. $url  = 'http://www.meinedomain.de/daten.php';
  5. // DIE GESENDETEN DATEN IN EIN ARRAY SETZEN
  6. $data = array('name' => 'Max', 'alter' => '25');
  7.  
  8. $options = array(
  9.     'http' => array(
  10.         'header'  => "Content-type: application/x-www-form-urlencoded\r\n",
  11.         'method'  => 'POST',
  12.         'content' => http_build_query($data)
  13.     )
  14. );
  15. $context  = stream_context_create($options);
  16. $result   = file_get_contents($url, false, $context);
  17. if ($result === FALSE) { /* HIER FEHLERBEHNADLUNG */ }
  18.  
  19. var_dump($result);
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement