с использованием
<?php
$post_arg = http_build_query( array('var'=>'varcontents') );
//create cURL connection
$ch = curl_init('http://localhost/target_url.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_arg);
$result = curl_exec($ch);
var_dump($result);
как «клиент» и
<?php
var_dump($_POST);
как target_url.php, вывод
<code>string(186) "<pre class='xdebug-var-dump' dir='ltr'>
<b>array</b>
'var' <font color='#888a85'>=></font> <small>string</small> <font color='#cc0000'>'varcontents'</font> <i>(length=11)</i>
»
(напоминает мне отключить эту опцию xdebug ;-)), поэтому в target_url.php параметры доступны через $ _POST.