Oczywiście że istnieje.
You can open an HTTP socket connection and send HTTP POST commands. Here is
an example :
Możemy użyć dwóch metod.
1.
Tradycyjnie - za pomocą połącznie socketowego i wysłania żądania HTTP POST.
<?
// Nagłówek zapytania
$ReqHeader =
\"POST $URI HTTP/1.1n\".
\"Host: $Hostn\".
\"Content-Type: application/x-www-form-urlencodedn\".
\"Content-Length: $ContentLengthnn\".
\"$ReqBodyn\";
// Otwórz połączenie
$socket = fsockopen ( $Host, 80
, &$errno, &$errstr ); if ( !$socket )
$Result [ \"errno\" ] = $errno;
$Result [ \"errstr\" ] = $errstr;
return $Result;
}
$idx = 0;
fputs( $socket, $ReqHeader ); while ( !feof ( $socket ) )
$Result [ $idx++ ] = fgets ( $socket, 128
); }
//-------------------------------------------
?>
2.
Rozszerzenie cURLJest to bajeczny wręcz sposób na osiągniecie twojego celu.
<?
$URL=\"www.mysite.com/test.php\";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,\"https://$URL\");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, \"Zmienna1=heh&Zmienna2=heh2\");
curl_exec ($ch);
curl_close ($ch);
?>
Zauważ że
nie potrzebujesz określać nagłówków.
Polecam drugi sposób. cURL powinno być wkompilowane w serwer.