<?php
function post($data, $url, $timeout=30)
{
$url_array = parse_url($url);
$len = strlen($data);
$headers =
"POST ".$url_array["path"]."?".$url_array["query"]." HTTP/1.1\n".
"Host: $url_array[host]\n".
"User-Agent: PHP/".phpversion()."\n".
"Content-Type: application/x-www-form-urlencoded\n".
"Content-Length: $len\n\n".
"$data\n";
$socket = fsockopen($url_array["host"], 80, $errno, $errstr, $timeout);
if (!$socket)
{
return false;
}
else
{
fputs($socket, $headers);
while(!feof($socket))
$in .= fgets($socket, 128);
return $in;
}
}
$xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n";
$xml .= "<gateway>\n";
$xml .= "<sid id=\"0\">\n";
$xml .= "<command> -send -to -email test@test.dk</command>\n";
$xml .= "</sid>\n";
$xml .= "</gateway>\n";
post($xml,"
http://www.noget.dk");
?>