I had a similar problem trying to send information to a form to the website for our companies SMS service provider.
This is the code we use to connect and send the post data:
$header = "POST <path to page> HTTP/1.0\n";
$header .= "Content-type: application/x-www-form-urlencoded\n";
$header .= "Content-length: " . strlen($request) . "\n\n";
$fp = fsockopen("<server name>", <server port>, $err_num, $err_msg);
if ($fp) {
fputs($fp, $header.$request);
while (!feof($fp)) {
$http_result .= fgets($fp, 4096);
}
fclose($fp);
for example if the page to post information to is http://www.myserver.com/pages/test.php then <server name> is www.myserver.com, <server port> is 80 and <path to page> is /pages/test.php.
Request is the information to send to the form in URLencoded format eg. foo=bar&foobar=foo+bar
hope this helps