I used the fsockopen command to open a connection to the server and post an XML doc to the server. In return, I used the fgets() command to get the response. This is a bit of my code that I think might be useful.
<?php
$xml="some XML Document";
$fp = fsockopen ("someserver.com", 80, $errno, $errstr, 30);
if (!$fp) {
// HTTP ERROR
echo "$errstr ($errno)";
} else {
fputs ($fp, $header . $xml);
while (!feof($fp)) {
echo fgets($fp,1024); //to print the XML doc on the screen
}
fclose ($fp);
?>
I am getting all the http headers and I think they are prohibiting me from displaying the XML doc on the screen. How actually do I strip the header off? Any commands?? By the way, this is the first time I do a HTTP Post. IN normal circumstances, how do I actually retrieve the reponse??