I need to POST xml data without CuRL.
there are a LOT of snippets, but nothing seems to work.
The latest attempt:
function salesOrder($xml, $url)
{
$context = stream_context_create(array(
'http' => array(
'method' => 'POST',
'header' => "Content-type: application/xml\r\n",
'content' => $xml,
'timeout' => 5,
),
));
$ret = file_get_contents($url, false, $context);
return false !== $ret;
}
returns nothing, blank page.
I have tried http://wezfurlong.org/blog/2006/nov/http-post-from-php-without-curl/
The problem is I dont really understand it and i can not seem to find a good tutorial that covers this problem. Can anyone point me in the right direction?
You can use this to achieve that
http://example.com/b.php