Maybe this little stream-based solution would do the trick. A stream context is created by passing all necessary params as part of an multidimensional array. Readfile() will output the result of this http-post-request.
Code:
<?php
$params = array(
'http' => array(
'method' => 'POST',
'user_agent' => 'Mozilla/5.0',
'content' => 'variable=value',
'header' => 'Accept-language: en\r\n'.
'Cookie: PHPSESSID=54321\r\n'.
'Cache-Control: max-age=0\r\n'.
'Content-Type: application/x-www-form-urlencoded\r\n'
)
);
$context = stream_context_create($params);
readfile('http://somehost.com/somescript.php', 0, $context);
?>
Best regards
Jörg