这是我的代码
<?php
$url = "http://mydomain.com/coupon/process.php";
$fields = array(
'lname'=>"sekhar",
);
if (!function_exists('curl_init')){
die('Sorry cURL is not installed!');
}
$ch = curl_init($url);
//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,TRUE);
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch,CURLOPT_POST,count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields);
//execute post
$result = curl_exec($ch);
//close connection
curl_close($ch);
?>
process.php包含
<?php
echo "hi...".$_POST['lname'];
?>
$ _ POST不显示。我只是输出“你好......”
相同的代码在我的本地服务器上运行良好。 Curl安装在两个服务器中。如果有人可以帮助我会很棒。