Skrtypt wysyłający:
<?
$context_options1 = array(
'http'=>array(
'method' => "GET",
'header' => "Accept-language: en\r\n" .
"Cookie: test=mapa\r\n"
)
);
$content2 = 'Tekst do wyslania: mapa Polski';
$context_options2 = array (
'http' => array (
'method' => 'POST',
'header' => "Content-Type: text/xml\r\n" .
"Content-Length: ".strlen($content2)."\r\n",
'content' => $content2
)
);
$content3 = 'Tekst do wyslania: najlepsza mapa Polski';
$context_options3 = array (
'http' => array (
'method' => 'POST',
'header' => "User-Agent: Mozilla4.0\r\n" .
"Host: www.wolakorybutowa.pl\r\n" .
"Content-Type: text/xml\r\n" .
"Content-Length: ".strlen($content3)."\r\n",
'content' => $content3
)
);
$context = stream_context_create($context_options2);
$fp = fopen('http://www.wolakorybutowa.pl/test/post_test.php', 'r', false, $context);
fpassthru($fp);
fclose($fp);
?>
Sktypt odbierający:
<?
// ini_set('always_populate_raw_post_data', true);
echo $HTTP_RAW_POST_DATA;
?>