<?php
function postVars($host,$path,$data,$port)
{
$socket = fsockopen($host,$port,&$errno,&$errstr);
if($socket)
{
fputs($socket, "POST $path HTTP/1.1\n");
fputs($socket, "Host: $host\n");
fputs($socket, "Content-type: application/x-www-form-urlencoded\n");
fputs($socket, "Content-length: " . strlen($data) . "\n");
fputs($socket, "User-Agent: PHP\n");
fputs($socket, "Connection: close\n\n");
fputs($socket, $data);
while (!feof($socket))
{
$readSocket .= fgets($socket,128);
}
fclose($socket);
The rest of this function does a bunch of messy things I use to read url encoded GET vars from my POST result. But it should be trivial to finish this up.