thanks Weedpacket.
I've looked around for fsocketopen() and now am trying to get the following code to work. It does send something, but I get an syntax error as response from the server I'm sending this xml:
$username="QLT";
$password="TLQ";
$voucherID = "11";
$mediaID = date("ymdhis");
$xml = "<?xml version=\"1.0\"?>";
$xml .= "<LoyaltyService Version=\"1.0\">";
$xml .= "<Session>";
$xml .= "<Identification>";
$xml .= "<UserName>$username</UserName>";
$xml .= "<Password>$password</Password>";
$xml .= "</Identification>";
$xml .= "</Session>";
$xml .= "<Submit Cmd=\"IssueVoucher\">";
$xml .= "<VoucherId>$voucherID</VoucherId>";
$xml .= "<MediaId>$mediaID</MediaId>";
$xml .= "<MediaType>CST</MediaType>";
$xml .= "</Submit>";
$xml .= "</LoyaltyService>";
$host = "xxx.xxx.xxx.xxx";
$mothod = "GET";
$path = "/xmlticketserver.asp";
$date = $xml;
function sendToHost($host,$method,$path,$data,$useragent=0)
{
// Supply a default method of GET if the one passed was empty
if (empty($method))
$method = 'GET';
$method = strtoupper($method);
$fp = fsockopen($host,80);
if ($method == 'GET')
$path .= '?' . $data;
fputs($fp, "$method $path HTTP/1.1\n");
fputs($fp, "Host: $host\n");
fputs($fp, "Content-type: text/xml\n");
fputs($fp, "Content-length: " . strlen($data) . "\n");
if ($useragent)
fputs($fp, "User-Agent: MSIE\n");
fputs($fp, "Connection: close\n\n");
if ($method == 'POST')
fputs($fp, $data);
while (!feof($fp))
$buf .= fgets($fp,128);
fclose($fp);
return $buf;
}
$parse = sendToHost($host,$method,$path,$data,false);
echo $parse;
thanks,
Karel